Conversation
aaececf to
70c64a4
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds the NUM_PROXIES configuration to Django REST Framework settings to fix throttling issues when the application is behind a proxy. The setting enables DRF to correctly identify client IP addresses by parsing the X-Forwarded-For header when the application sits behind multiple proxies (CDN, load balancer, etc.).
Changes:
- Adds
NUM_PROXIESsetting toREST_FRAMEWORKconfiguration with a default value of 3, configurable via theDRF_NUM_PROXIESenvironment variable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'anon': '100/day', | ||
| 'user': '3000/day', | ||
| }, | ||
| 'NUM_PROXIES': 3, |
There was a problem hiding this comment.
Before:
AWS ALB (Network) -> nginx-ingress -> nginx (container) -> gunicorn
After:
AWS ELB (Classic) ->. Traefik -> nginx (container) -> gunicorn
So... yeah I think 3 is correct since ALB doesn't do anything with X-Forwarded-For.
But why did it work before without being configured as 2?
There was a problem hiding this comment.
maybe just traefik behaving differently from nginx ingress?
Fixes #2891