This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log_format main '$remote_addr - "$http_x_forwarded_for" - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent"' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://aws-lb-adresiniz.elb.amazonaws.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -i --header "X-Forwarded-For: 1.1.1.1, 2.2.2.2" http://aws-lb-adresiniz.elb.amazonaws.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getClientIP() | |
{ | |
if ($_SERVER['HTTP_X_FORWARDED_FOR']) { | |
$ip_exp = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); | |
$c = count($ip_exp) - 2; | |
$real_ip = trim($ip_exp[$c]); | |
return $_SERVER['REMOTE_ADDR'] = $real_ip; | |
} else { | |
return $_SERVER['REMOTE_ADDR']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getClientIP() | |
{ | |
if ($_SERVER['HTTP_X_FORWARDED_FOR']) { | |
$ip_exp = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); | |
$c = count($ip_exp) - 1; | |
$real_ip = trim($ip_exp[$c]); | |
return $_SERVER['REMOTE_ADDR'] = $real_ip; | |
} else { | |
return $_SERVER['REMOTE_ADDR']; | |
} |