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
Behind Amazon Beanstalk, not giving me the right ip #7
Comments
Hi! Sorry to hear that! I have a quick question that's mostly out of my own ignorance - does "behind Amazon Beanstalk" mean "it's using a Load Balancer"? My understanding is that Amazon's ElasticBeanstalk handles deployment, rather than acting as a proxy (such as a load balancer). It's sounds likely that Beanstalk is creating a load balancer for you as part of your deployment strategy? In any case, let me run some tests against the use of the
|
Update: I tested using Note that config should be in array if you have one or more IP addresses:
Or a string to use
Lastly, you can also use CIDR notation, so consider setting that IP address to attempt to capture IP's in this range:
|
I've just tested this, and it does indeed work when using a correct CIDR address of the Load Balancer, or * ( That said, Amazon does appear to vary the headers it sends for X-Forwarded-. The Symfony component relies on knowing where to find the scheme/protocol, and the forwarded for headers.
Is it perhaps worth you implementing configuration options to utilise the setTrustedHeaderName method?
That way, apps behind other load balancers which may not utilise the exact header name can be easily catered for. |
Yea that would be well worth it I think! On Tuesday, November 18, 2014, Ben Swinburne notifications@github.com
|
@benswinburne it's worth noting that the Header sent as "X-Forwarded_Proto" will actually become However, this is still a great suggestion. I think HAProxy in particular uses |
Also, functionality added in update to package on develop branch, ready for when Laravel 5 comes out, Thanks again for the pointer in the direction of |
I just tried this on an amazon beanstalk configuration, proxy is set to *. The issue is when I run Request::getClientIp() I get 10.107.15.71 but my client ip is really 203.61.26.1 so it's returning me this other IP I'm not sure what it is.
The text was updated successfully, but these errors were encountered: