-
Notifications
You must be signed in to change notification settings - Fork 146
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
Not Handling X-Forwarded-For from LBs #709
Comments
So it seems to be doing something when i added this to the
because my login IP changed from
The X-Forwarded-For Header should be looking something like this:
Based on this documentation: https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers- |
Hi, seems the easiest way for you is to add a dependency which has been built to handle cloudflare proxying headers : https://github.com/monicahq/laravel-cloudflare it will maintain cloudflare published IP addresses used for proxying in a cache (that you can reload automatically, using your scheduler). Since you are on docker, you can add That file will be located at |
So i went in and modified the LogFormat to get the
And noticed the big problem of the
So now I'm going to try and modify
Though when i do this i get this fatal error (and still looking into it):
My goal is to replace the above associative array with this change:
So i can get the correct IP. |
So for me I'm having Traefik Rewrite X-Real-IP (Originally would show 172.23.0.1 for connections), with X-Forward-IP or CF-Connecting-IP as long as it doesn't match X will replace, which shows the real ip of the connecting user from the cloudflare LB's, |
which application are you using ? SeAT is not doing anything with reverse except standard Laravel stuff :/ |
@AstralDestiny I personal think it's Traefik messing with the X-Forward-IP header completely overwriting the comma delimiter IPs instead of appending to the list. Hence why I was trying to force Laravel (aka., Symfony) to use |
TRUSTED_PROXIES
by adding this to.env
:Expected: Expected original IP not LB IP
Logs / Screenshots / Proof:
List of cloudflare LB CIDRs: https://www.cloudflare.com/ips-v4
Version Info:
The text was updated successfully, but these errors were encountered: