我想匹配请求参数并直接指向我的网关,我确实是这样
位置/ app / share {
if ($args ~ action=encode) {
proxy_pass http://192.168.1.249:11201/openmallservice/corp/app/share/;
}
}
怎么了?
答案 0 :(得分:1)
选中this answer。
/some-url/
部分在proxy_pass
语句的if
和location ~ whatever
# add uri here and break to stop searching another locations
rewrite ^(.*)$ /your-path$1 break;
# proxy without uri
proxy_pass http://111.222.33.44:8000;