Closed
Description
When a variable is used in proxy_pass
directive, the location header is not longer adjusted. This causes the value coming from backend to make its way back to client. To get around this, simply set proxy_redirect
.
This will not fix up location redirect:
location = /proxy/ {
set $endpoint proxy.com;
resolver 8.8.8.8 valid=10s;
proxy_pass https://$endpoint/;
}
This will:
location = /proxy/ {
set $endpoint proxy.com;
resolver 8.8.8.8 valid=10s;
proxy_pass https://$endpoint/;
proxy_redirect https://$endpoint/ /;
}
You can define proxy_redirect
on server context if used in multiple locations.
This a single line in docs that mention it:
The default parameter is not permitted if proxy_pass is specified using variables.
Metadata
Metadata
Assignees
Labels
No labels