alias address in REMOTE_ADDR
| From: | Tóth Csaba | Date: | Sat, 12 May 2012 05:57:19 +0000 |
| Subject: | alias address in REMOTE_ADDR | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-317853@lists.php.net to get a copy of this message | ||
Hi Everyone,
I've run into a curious problem, not even really sure it's PHP, but that's where
I caught it, so here it is:
I have two servers hanging on the net, without proxies. Let's call them Server1
and Server2. Server1 has multiple IP addresses, configured as aliases. My problem:
When I do a wget --spider from 1 to 2, I get the eth0 (not alias) address in
Apache's accesslog on Server2. But when I do a file_get_contents(http://server2.tld),
and observe the $_SERVER['REMOTE_ADDR'] on Server2, I get one of the alias IP addresses
back. What can cause this? I really need the eth0 IP address back in REMOTE_ADDR.
Regards,
Csaba