地址分享: https://www.cnblogs.com/taiyonghai/p/6728707.html
# nginx.conf配置
upstream testreport { least_conn; server 192.168.245.130:8080; #server 192.168.245.130:8081; } server { listen 8000; server_name test.com; location /hello { proxy_pass http://testreport; } }
浏览器访问 http://test.com:8000/hello/ ,就可以打开想要的页面
nginx用的最多的还是负载均衡, 关于upstream的各个参数最好还是查看官网介绍, 介绍的也比较详细: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream