Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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.


Comment on Re: REMOTE_ADDR not working
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-08-27 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls