【发布时间】:2010-09-20 03:22:12
【问题描述】:
我使用upstream 和proxy 进行负载平衡。
指令proxy_pass http://upstream_name 使用默认端口,即80。
但是,如果上游服务器没有监听这个端口,那么请求就会失败。
如何指定备用端口?
我的配置:
http{
#...
upstream myups{
server 192.168.1.100:6666;
server 192.168.1.101:9999;
}
#....
server{
listen 81;
#.....
location ~ /myapp {
proxy_pass http://myups:81/;
}
}
nginx -t:
[warn]: upstream "myups" may not have port 81 in /opt/nginx/conf/nginx.conf:78.
【问题讨论】:
-
请编辑它以使其有意义。我看到似乎是 Nginx 配置的片段和对尝试的解决方案的模糊(并且在内部是荒谬的)描述。我没有看到任何迹象表明实际问题是什么,或者提问者已经阅读了可用的文档。
-
作为
nginx用户,我仅通过标题就理解了这个问题。同意,属于顺丰。
标签: nginx