RJM62
Touchdown! Greaser!
- Joined
- Jun 15, 2007
- Messages
- 13,157
- Location
- Upstate New York
- Display Name
Display name:
Geek on the Hill
My present hosting is mirrored for redundancy. The mirroring works well, but I've noticed a side effect that I'm trying to work around.
The way the system works is that all traffic is routed first to the slave server. The slave queries the master and, if the master is online and healthy, forwards all requests to the master. If the master goes down, then the slave processes the requests itself until the master is back online.
Some of my applications (like the spam-filtering form) grab the visitor's IP address. But because of the way this server is set up, all I get is the IP of the slave server.
Now, I know that it's possible to grab the actual user's IP because my stats software and firewall do it. But when using my own PHP scripts, $_SERVER['REMOTE_ADDR'] returns the slave server's public IP address, and $_SERVER['HTTP_X_FORWARDED_FOR'] returns an empty result.
Anyone have any ideas?
-Rich
The way the system works is that all traffic is routed first to the slave server. The slave queries the master and, if the master is online and healthy, forwards all requests to the master. If the master goes down, then the slave processes the requests itself until the master is back online.
Some of my applications (like the spam-filtering form) grab the visitor's IP address. But because of the way this server is set up, all I get is the IP of the slave server.
Now, I know that it's possible to grab the actual user's IP because my stats software and firewall do it. But when using my own PHP scripts, $_SERVER['REMOTE_ADDR'] returns the slave server's public IP address, and $_SERVER['HTTP_X_FORWARDED_FOR'] returns an empty result.
Anyone have any ideas?
-Rich