Answer the question
In order to leave comments, you need to log in
How to change the proxy_pass config correctly?
Good afternoon. There was a question yesterday, but it does not take off.
We have a regular (test) nginx, we need to redirect using proxy_pass
if location is specified / (as root) everything works fine, there are no problems.
But I want /redirect to be specified (any other link doesn't matter)... but then site.ru/redirect opens... and even I can't get rid of it with rewrite... Help kind people)
Yes, I tried add a slash at the end of the domain - does not help...
a piece of the config
location /redirect {
proxy_pass https://www.google.com;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect default;
}
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