cbdevnet/ipmagnet

Reverse proxy IP address is reported with using a reverse proxy

Closed this issue · 3 comments

Reverse proxy IP address is reported with using a reverse proxy

Any news on this, i got the same problem

To get the original requester address when ipmagnet is deployed behind a reverse proxy, you'll need to change REMOTE_ADDR on https://github.com/cbdevnet/ipmagnet/blob/master/index.php#L25 and following to HTTP_X_FORWARDED_FOR.

Additionally, you need to ensure that the proxying server accurately sets the X-Forwarded-For Header for proxied requests (and that it overwrites it if provided from the client connection).

This is an advanced usecase and thus I would be hesitant to add it to the default configuration.

Thank you very much, got it working now!
Maybe this can be input into the readme?