配置看了好久没啥问题啊,跟着网上的帖子做的,各位大佬帮忙看看吧,求求了
4条回答 默认 最新
- liyanjing1210 2020-03-25 11:42关注
服务器集群名称,采用负载策略是轮询权重
upstream balance.com {
server 172.16.100.7:8001 weight=1 max_fails=3 fail_timeout=30s;
server 172.16.100.8:8001 weight=2 max_fails=3 fail_timeout=30s down;
}
server {
listen 80;
server_name 127.0.0.1;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
#将请求转向 balance.com 定义的服务器列表
proxy_pass http://balance.com;#允许重新定义或添加字段传递给代理服务器的请求头,请阅读proxy_set_header #端口号是容器对应的宿主机的port proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; proxy_set_header Cookie $http_cookie; proxy_redirect off; #expires 1d; }
}
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 素材场景中光线烘焙后灯光失效
- ¥15 请教一下各位,为什么我这个没有实现模拟点击
- ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 ubuntu子系统密码忘记
- ¥15 保护模式-系统加载-段寄存器