Amazon EC2 web server shows an incorrect client IP in PHP -
i have 1 load balancer , 3 ec2 web servers linux , apache. whenever use $_server['remote_addr'] in php take website's visitor's ip addresses, shows me wrong ip address. when check ip in whois databases find reserved ip. guess ip of server in aws instead of client's ip. how can correct client's ip php in ec2 servers?
the ip local amazon ip because visitors not connect server directly.
normally load balancer forwards real client ip in $_server array under new key, in cases $_server['http_x_forwarded_for']
Very informative blog. I found this information very helpful. I want more information about EC2 web server. Thanks for sharing.
ReplyDelete