- 首先,每台服务器单独访问接口都是正常的。
- 然后,配置上负载均衡之后,只要代理请求到172服务器的登录接口,就返回404,访问本机就是正常的
- 登录成功之后,其他的接口两台服务器都是正常的
- 配置如下
upstream test_pools{
#ip_hash;
server 127.0.0.1:8081;
#ip隐藏了中间部分
server 172.*.*.128:8081;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
}
server{
listen 80;
server_name test.appcpt.com;
location / {
# proxy_next_upstream http_502 http_504 error timeout invalid_header;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header Host $host:$server_port;
proxy_pass http://test_pools/;
}
location /nstatus {
check_status;
access_log off;
}
}
- 哪位大佬可以指正下小弟哪里配置有问题