Question
How to get the true IP of the user with Load Balancer and LAMP?
I’m using Load Balancer and LAMP in my application.
But in a feature of my application it is necessary to get the true IP of who is accessing.
I tried with PHP in several ways like:
$ SERVER [‘HTTPCLIENT_IP’]
$ SERVER ['HTTPXFORWARDEDFOR’]
$ SERVER ['HTTPXFORWARDEDFOR’]
But none of these worked, I always get the Load Balancer IP. Can anybody help me?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×