我用 vmware+centos 做了 3 个虚拟机,用 nginx 做负载均衡。 分别是 192.168.8.128 ,192.168.8.129 ,192.168.8.130 3 台虚拟机上都安装了 nginx 192.168.8.128 作为代理服务器 192.168.8.129 ,192.168.8.130 这 2 台服务器提供的内容都是只有一个静态的 index.html 文件 单独访问这 2 台服务器都可以打开 如果代理服务器配置修改成 proxy_pass http://192.168.8.129:80; 访问 192.168.8.128 会显示 http://192.168.8.129 下的网页内容 但是代理服务器如果用 upstream,配置文件如下: upstream proxy_servers { server 192.168.8.129:80; server 192.168.8.130:80; } server { listen 80; server_name localhost; index index.html; location / { proxy_pass http://proxy_servers; } } 访问 192.168.8.128 总是 502 错误。日志都是: upstream prematurely closed connection while reading response header from upstream 或: no live upstreams while connecting to upstream 求助!
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.