如何使用nginx通过proxy_pass转发查询字符串参数? [英] How can query string parameters be forwarded through a proxy_pass with nginx?
本文介绍了如何使用nginx通过proxy_pass转发查询字符串参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
upstream apache {
server 127.0.0.1:8080;
}
server{
location ~* ^/service/(.*)$ {
proxy_pass http://apache/$1;
proxy_redirect off;
}
}
以上代码段会将网址中包含字符串"service"的请求重定向到另一台服务器,但其中不包含查询参数.
The above snippet will redirect requests where the url includes the string "service" to another server, but it does not include query parameters.
推荐答案
查看全文