Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: REMOTE_ADDR not working

by rowdog (Curate)
on Jan 30, 2011 at 04:21 UTC ( #885096=note: print w/replies, xml ) Need Help??

in reply to REMOTE_ADDR not working

I haven't ever dealt with Amazon and I don't know much about web proxies but it sounds like you're getting a proxy address for all the requests. Maybe Amazon is running a reverse proxy?

Well, if I'm right, there should be other headers you can use. One way to check would be to dump %ENV and see if you find any proxy headers.

Replies are listed 'Best First'.
Re^2: REMOTE_ADDR not working
by chrestomanci (Priest) on Jan 30, 2011 at 19:58 UTC

    Most likely Amazon are running a load balancer, so that if you have multiple machines running the same http server, the load gets shared between them automatically. It also allows Amazon to save on public routeable IP addresses, which as we know are becoming a scarce resource.

    As others have said, you need to examine the headers, to look for one that contains the original IP address. Most likey it will be HTTP_X_FORWARDED_FOR, but it is entirely possible that Amazon have decided to do their own thing.

    The other thing to be aware of is that your clients will most likely be behind a proxy from their ISP, so you are unlikely to see their real IP address. If you are lucky, the proxy at the client end will also have put the IP address in a special header. The other possibility is that both proxies put the IP addresses in HTTP_X_FORWARDED_FOR, to create a comma separated list of IP addresses.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885096]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2020-09-27 00:31 GMT
Find Nodes?
    Voting Booth?
    If at first I dont succeed, I

    Results (142 votes). Check out past polls.