使用nginx反向代理容器flask接口的時(shí)候粉私,發(fā)現(xiàn)問(wèn)題
- nginx中使用容器名+端口+uri,訪問(wèn)url傳參陌宿,能夠正常獲取url中?之后的參數(shù)
location /test {
include /etc/nginx/proxy.conf;
proxy_pass http://pipeline:8888/test;
}
- nginx中使用ip+端口+uri染服,訪問(wèn)url傳參懒浮,無(wú)法獲取url中?之后的參數(shù)
location /test {
include /etc/nginx/proxy.conf;
proxy_pass http://11.11.11.1:8888/test;
}
解決:ip+端口+uri+$args
location /test {
include /etc/nginx/proxy.conf;
proxy_pass http://11.11.11.1:8888/test$args;
}
來(lái)源:
nginx-get請(qǐng)求參數(shù)丟失 - 掘金 (juejin.cn)