fix(web): disable absolute_redirect in nginx to avoid leaking internal URL - #991
fix(web): disable absolute_redirect in nginx to avoid leaking internal URL#991epipra wants to merge 1 commit into
Conversation
…l URL nginx's default absolute_redirect guesses scheme/host/port from its own listen directive when emitting directory redirects (e.g. /blog -> /blog/). Behind a reverse proxy that terminates TLS and forwards to this container over plain HTTP (Caddy, nginx, Traefik, etc. in front), that produces a Location header like http://<container-host>:3000/blog/ sent straight to real visitors instead of the public https:// URL. Setting absolute_redirect off makes nginx emit a relative redirect instead, which the browser resolves against the actual request URL. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
root seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Greptile SummaryThis PR prevents nginx from exposing its internal scheme, host, and port when generating directory redirects behind a TLS-terminating reverse proxy.
Confidence Score: 5/5The PR appears safe to merge and correctly limits nginx-generated redirects to relative locations. The directive is supported by the configured nginx image, valid in the server context, and no callers or deployments were found that depend on absolute redirect locations. Important Files Changed
Reviews (1): Last reviewed commit: "fix(web): disable absolute_redirect in n..." | Re-trigger Greptile |
Up to standards ✅🟢 Issues
|
|
Hello @epipra |
Summary
absolute_redirectguesses scheme/host/port from its ownlistendirective when emitting directory redirects (e.g./blog->/blog/)Locationheader likehttp://<container-host>:3000/blog/sent straight to real visitors instead of the publichttps://URLabsolute_redirect offmakes nginx emit a relative redirect instead, which the browser resolves against the actual request URLTest plan
curl -sI https://<host>/blogand confirm theLocationheader is relative (/blog/), not an internalhttp://host:port/blog/URL