Answer the question
In order to leave comments, you need to log in
How does Nginx proxy rewrite response?
Comrades, Connoisseurs!
There is nginx in proxy mode, proxying is configured. Can't publish second resource under office.
Example situation:
When accessing the example.com domain , proxying goes to 10.100.0.70 and everything works fine. When I access example.com/office backend forwards me to example.com/welcome/, and I need to example.com/office/welcome/.
I assume that it is necessary to rewrite backend responses. But how?
location / {
proxy_pass_header Authorization;
proxy_pass http://10.100.0.70;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Front-End-Https on;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect off;
}
location /office/ {
if ($request_uri ~* "/office/(.*)") {
proxy_pass http://10.11.10.22/$1;
}
}
Answer the question
In order to leave comments, you need to log in
location /office/ {
proxy_pass http://10.11.10.22/;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question