Example configuration
location /example {
set $exampleVariable "examplePath";
proxy_pass http://localhost:8080/$exampleVariable;
}
Example url
http://example.com/example/my/sub/dir
We expect the proxy_pass to request the uri "http://localhost:8080/$exampleVariable/my/sub/dir".
The proxy_pass uri looks like that "http://localhost:8080/$exampleVariable"
Not found out so far, but based on the example above its clear, that a variable in the proxy_pass uri is causing the loss of the received location path.
- Don't use variables in your proxy_pass
- Update the location like that
location /example {
set $exampleVariable "examplePath";
rewrite ^\/example\/(.*)$ /$1 break;
proxy_pass http://localhost:8080/$exampleVariable/$1;
}