configuração de verniz:
if (req.restarts == 0) {
if (req.http.X-Forwarded-For) {
set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;
} else {
set req.http.X-Forwarded-For = client.ip;
}
}
seções de configuração do apache 2.4:
mod_remoteip:
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 127.0.0.1/8
registro (% a faz o trabalho):
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+
se houver um nginx na frente (ex. terminação SSL):
server {
listen 123.123.123.123:443;
server_name server.com;
root html;
ssl on;
ssl_certificate /etc/pki/httpd/site/chain.crt;
ssl_certificate_key /etc/pki/httpd/site/private.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:6081;
proxy_set_header Host $http_host;
proxy_pass_header Server;
proxy_set_header X-Forwarded-For $remote_addr;
}
}