Apache get real IP from NGINX proxy

 

Apache get real IP from NGINX proxy 

nginx: 

set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;

service nginx reload

##################################
apache2:

a2enconf remoteip
a2enmod remoteip

pico /etc/apache2/conf-available/remoteip.conf
 

add:
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy <IP_NGINX>


service apache2 restart

Apache get real IP from NGINX proxy

  Apache get real IP from NGINX proxy  nginx:  set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; proxy_set_h...

Mais vistos