default.conf or what you want
vim /etc/nginx/conf.d/default.conf
add proxy_set_header for php files
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
a2enmod remoteip
vim /etc/apache2/conf-available/remoteip.conf
and add
<IfModule mod_remoteip.c>
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 127.0.0.1
</IfModule>
Add active this conf with
a2enconf remoteip
service apache2 restart
And now apache logs and $SERVER['REMOTE_ADDR'] have the real IP ;-)
Thanks!