fix: enable real client IP extraction for load balancing behind rever…#859
fix: enable real client IP extraction for load balancing behind rever…#859
Conversation
…se proxy When deployed behind another reverse proxy (npm, traefik, etc.), the nginx ip_hash directive was seeing the proxy's IP for all clients, routing all traffic to a single backend replica. This change configures nginx to extract the real client IP from the X-Forwarded-For header, enabling proper load distribution across all replicas while maintaining sticky sessions per client. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughNginx configuration updated to extract real client IP addresses from X-Forwarded-For headers within the http context, including proxy trust settings and recursive IP processing, while retaining the existing upstream server configuration with sticky sessions via ip_hash. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #859 +/- ##
=======================================
Coverage 80.04% 80.04%
=======================================
Files 165 165
Lines 20131 20131
=======================================
Hits 16114 16114
Misses 4017 4017 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…se proxy
When deployed behind another reverse proxy (npm, traefik, etc.), the nginx ip_hash directive was seeing the proxy's IP for all clients, routing all traffic to a single backend replica.
This change configures nginx to extract the real client IP from the X-Forwarded-For header, enabling proper load distribution across all replicas while maintaining sticky sessions per client.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.