Closed wivaku closed 6 years ago
As a workaround I have added a failsafe switch in order to deactivate the internal resolver. Background: The resolver is responsible for resolving the host in periodical intervals. I have added this on order to reroute to restarted docker containers with new ip.
The switch is the environment variable REVERSE_PROXY_DISABLE_RESOLVER
. Value: true or false (Default: false). Will switch back to nginx default behavior for this proxy.
Example:
docker run -d \
-p 80:80 \
--name nginx \
-e "SERVER1REVERSE_PROXY_LOCATION1=/" \
-e "SERVER1REVERSE_PROXY_PASS1=http://www.heise.de" \
-e "SERVER1REVERSE_PROXY_DISABLE_RESOLVER1=true" \
blacklabelops/nginx
Should now even work without disabling resolver!
The nginx documentation describes the functionality as I would expect it:
Note the trailing / at the end of the proxy_pass URL. This correctly replaces the part of the request URI that matches the location parameter:
myproxy.com/some/path/page.html --> www.example.com/link/page.html
But, when using:
The original URI is added to the URI of the upstream:
myproxy.com/some/path/page.html --> www.example.com/link//some/path2/page.html