为了区分正式和测试环境, 部署了两个相同的java程序 地址分别是
http://127.0.0.1:8812
http://127.0.0.1:8813
base url是 /paiban
用nginx做代理
nginx配置文件这样写的
# 排班
location /paiban {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_connect_timeout 3s;
proxy_read_timeout 86400s;
proxy_pass http://127.0.0.1:8812;
}
# 排班test
location /paiban-test {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_connect_timeout 3s;
proxy_read_timeout 86400s;
proxy_pass http://127.0.0.1:8813/paiban/;
}
通过api访问一切正常
但是通过swagger访问 /paiban-test 总是问访问到/paiban
swagger的文件路径是正常的 其他接口就会访问到错的地址