[url]http://blog.youkuaiyun.com/wang379275614/article/details/47778201[/url]
upstream mytest.com{
server 127.0.0.1:8080 weight=1;
server 127.0.0.1:8082 weight=2;
}
location / {
#root html;
#index index.html index.htm;
proxy_pass http://mytest.com;
proxy_redirect default;
}
location /Nginxstatus {
stub_status on;
access_log D:/GreenSoftware/nginx-1.12.1/logs/status.log; #日志
auth_basic "NginxStatus";
}
upstream mytest.com{
server 127.0.0.1:8080 weight=1;
server 127.0.0.1:8082 weight=2;
}
location / {
#root html;
#index index.html index.htm;
proxy_pass http://mytest.com;
proxy_redirect default;
}
location /Nginxstatus {
stub_status on;
access_log D:/GreenSoftware/nginx-1.12.1/logs/status.log; #日志
auth_basic "NginxStatus";
}
本文详细介绍了Nginx中upstream和location指令的具体用法,包括如何设置服务器权重及代理传递等高级配置,并展示了如何使用Nginx监控模块来收集状态信息。
1894

被折叠的 条评论
为什么被折叠?



