Suppose there's a nginx configuration:
server {
...
location /nakayoshi {
if ($georedirect) {
proxy_pass http://foo.bar/fa/fb/fc;
}
proxy_pass http://foo.bar/fa/fb/fd;
}
}
When I sudo nginx -t, it prints out:
nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular express, or inside named location, or inside "if" statement, or inside "limit_except" block in /etc/nginx/conf.d/nakayoshi.conf
Also I've found rewrite help me here, but the redirected uri will change to urls like "http://foo.bar/fa/fb/fc".
Can I keep the redirected uris unchanged with proxy_pass?