upstream apache {
server 127.0.0.1:8080;
}
server{
location ~* ^/service/(.*)$ {
proxy_pass http://apache/$1;
proxy_redirect off;
}
}
Run Code Online (Sandbox Code Playgroud)
上面的代码片段会将url包含字符串"service"的请求重定向到另一台服务器,但它不包含查询参数.