【发布时间】:2017-08-07 15:15:30
【问题描述】:
我想用 nginx 和 IIS 在单个服务器上测试负载平衡。 我设置 nginx 监听 localhost:90 和 IIS 上的两个网站监听 localhost:81 和 localhost:82
这是我的nginx.conf:
events {
worker_connections 1024;
}
http {
upstream backend {
server localhost:81;
server localhost:82;
}
server {
listen 90;
server_name backend;
location / {
proxy_pass http://localhost:80;
}
}
}
当我在浏览器上打开 http://localhost:90 时,它返回 504 Gateway Time-out。
实际上请求将发送到端口 80(我在 proxy_pass 中设置)而不是端口 81 和 82
我知道负载平衡适用于我们有多个服务器的情况。 但是有什么方法可以在具有多个端口的单个服务器上测试负载平衡?
【问题讨论】:
标签: iis nginx load-balancing