By ufirst
Estou usando o Load Balancer e LAMP, na minha aplicação. Porém em uma funcionalidade da minha aplicação é necessário pegar o IP verdadeiro de quem está acessando. Eu tentei com PHP de várias formas como: $_SERVER[‘HTTP_CLIENT_IP’] $_SERVER[‘HTTP_X_FORWARDED_FOR’] $_SERVER[‘HTTP_X_FORWARDED_FOR’] , mas nenhuma dessas funcionou, sempre me retorna o IP do Load Balancer. Alguem poderia me ajudar?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
To fix the problem you need to make sure that the remoteip_module Apache module is loaded.
You can follow the steps listed in the answer here on how to setup and configure that:
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.