Repository navigation
fix(nginx): relative Location on every redirect behind a TLS proxy - #4786
Conversation
The image's nginx listens on plain HTTP, so when TLS ends at an upstream proxy a directory redirect (/about -> /about/) carried an absolute Location: http://host/about/. absolute_redirect off at server level makes every redirect relative, so the browser keeps the public scheme and host. Closes #4784 Claude-Session: https://claude.ai/code/session_012XGDJoHpND6B3qk6SCWKmU
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Redirect configuration nginx.example.conf |
Adds a comment about the proxy and TLS context and disables absolute redirects. |
Priority:
Estimated code review effort: 1 (Trivial) | ~4 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: 
Minimal · up to 04f3c
-
The server-level redirect configuration matches the stated TLS-proxy objective.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#4784requiresabsolute_redirect off;at server level fornginx.example.conf. The pull request adds this directive to theserverblock. The existingtry_files $uri $uri/ /index.htmlremains in scope, and the reported checks show relative slash redirects and preserved query strings. The directive also preserves the requested direct-serving behavior while preventing scheme-specific absolute locations behind a TLS proxy.
Full details: Out of Scope Changes check
-
Explanation
The diff changes only
nginx.example.conf. It adds the server-level redirect directive and comments that explain the TLS-proxy case and inherited redirect coverage. These changes support issue#4784and introduce no demonstrated unrelated behavior.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
-
Full details: Description check
-
Explanation
The description explains what changed, why it changed, how it was implemented, the related issue, and the reported validation results. It does not follow the repository template and omits the required Scope, Guardrails check, and Notes sections.
Resolution
Rewrite the description using the repository template. Add the impacted modules, cross-module impact, risk level, validation checklist, guardrails checklist, and reviewer notes. Retain the existing change rationale, test results, and issue reference.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4786 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 43 43
Lines 1585 1585
Branches 490 490
=======================================
Hits 1579 1579
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What — a directory URL typed without its trailing slash (
/about) now redirects with a relativeLocation: /about/, so behind a TLS-terminating proxy the browser stays on https instead of being sent tohttp://host/about/.How —
absolute_redirect off;atserverlevel innginx.example.conf. Inherited by everylocation, it also covers anyreturn 30xa consumer adds.Checked —
nginx -tok; served locally:/about→301 Location: /about/,/about?a=1→/about/?a=1,/about/→ 200, unknown path → SPA fallback 200.Closes #4784
https://claude.ai/code/session_012XGDJoHpND6B3qk6SCWKmU
Summary by CodeRabbit