Incorrect IP address PHP
Posted: Fri Apr 07, 2017 6:02 pm
Heya,
If I use the following code:
Then I'm seeing the IP address of my webserver. However, HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR does show the correct IP address.
I am not going to replace all my scripts with that. I just want it to give the correct IP via REMOTE_ADDR.
It's a clean installation on Ubuntu 16.04 minimal. All latests updates and PHP 7.
Does anybody knows how to fix this?
If I use the following code:
Code: Select all
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
I am not going to replace all my scripts with that. I just want it to give the correct IP via REMOTE_ADDR.
It's a clean installation on Ubuntu 16.04 minimal. All latests updates and PHP 7.
Does anybody knows how to fix this?