Log user IP with PHP -
currently i'm using script log users ip adresses:
$userip = $_server['remote_addr'];
however, after bought anti-ddos http proxy, returns proxy ip instead.
$_server['remote_addr'] -> 198.12.12.102
i'm using cloudflare proxy, i've entered proxy's ip inside ip field in cloudflare , selected 'bypass cloudflare network'.
well, yes, if request proxied, php sees proxy's address. in case, and in case, should @ alternative http headers. proxy may, should, add original ip address http header, x-forwarded-for
, available in $_server['http_x_forwarded_for']
.
usually it's security risk pay attention these headers; if know your proxy you control explicitly adds header on your behalf should use it.
Comments
Post a Comment