-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from X-Real-IP to X-Forwarded-For in nginx.conf #3929
base: develop
Are you sure you want to change the base?
Conversation
X-Forwarded-For is more commonly used across various proxies and load balancers, including Cloudflare, which does not use X-Real-IP.
Just realized that we could make it a variable so that way people could change it to whatever they want. But I still believe we should make the default x-forwarded-for instead of x-real-ip |
I'm having to mount a custom |
CI Error:
|
I believe X-Real-IP may be used instead of X-Forwarded-For if a non-trusted proxy spoofs the IP in X-Forwarded-For. This is from my research when I had this issue with Cloudflare proxies making NPM output incorrect IP in the logs. Let me know if I'm wrong and X-Real-IP can actually be spoofed. It looks like nginx sets x-real-ip to $remote_addr, so it'd be the most trustworthy and why it's default Therefore, I used CF-Connecting-IP (X-Forwarded-For equivalent) for my domains with CF's proxy enabled. For domains disabled, I leave it as-is because it will give the literal connecting IP address rather than what the provided header says |
With Cloudflare, the source of truth is from the An option in the user interface to list all trusted IPs (beyond those already sourced) and to set the |
X-Forwarded-For is more commonly used across various proxies and load balancers, including Cloudflare, which does not use X-Real-IP.
This should fix #3582 #3267 #1358 #1230