Answer the question
In order to leave comments, you need to log in
Is proxy_pass inherited in nested locations in nginx?
Let's say we have an nginx config:
location /webapp {
location /webapp/user {
if ($arg_callback = '') {
return 403;
}
}
client_max_body_size 150m;
proxy_pass localhost :8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
In this case, /webapp/user is not proxied.
If I duplicate the proxy_pass configuration from the first location (/webapp), then everything starts working.
I really would not want to copy-paste proxy_pass, so who knows how to make it inherit?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question