server { listen 80; server_name _; # The trailing slash on proxy_pass strips /it-tools/ before the request reaches the # container. It works the other way round too -- `proxy_pass http://it-tools-subfolder:8080;` # forwards the prefix as-is -- because the app's own nginx.conf handles both. location /it-tools/ { proxy_pass http://it-tools-subfolder:8080/; } location /it-tools { return 301 /it-tools/; } }