Hi
I have the following setup:
INTERNET
\/
LOAD BALANCER RUNNING NGINX WITH UPSTREAM MODULE
\/
2 x WEB SERVERS WITH NGINX REVERSE PROXY + APACHE BACKEND
I have set up the X-Forwarded-For headers on both the load balancer and the web servers, however, the LB shows the correct IP in the logs. On the web servers, it only shows the IP address of the Load Balancer. I presume I need to change something to get the correct IP?
I am using the mod_rpaf module on the apache backend
ON LB:
server {
listen 80;
server_name www.domain.com;
proxy_connect_timeout 3s;
proxy_buffers 32 16k;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_pass http://cluster;
}
}
ON WEB:
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Many thanks