Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

proxy_add_x_forwarded_for giving invalid IP address

$
0
0
We are using Nginx to terminate SSL and passing the requests to Varnish and then to Apache
We are getting invalid IP address from Nginx proxy_add_x_forwarded_for and remote_addr
Please find the Nginx settings as mentioned below:


FYI..
SSL is on port 443
Varnish is on port 80
Apache is on port 8080


Nginx Settings:
---------------------------
server {
listen *:443 ssl;
server_name *.website.com;

ssl on;
ssl_certificate /tmp/nginx_prabhathkota.crt;
ssl_certificate_key /tmp/prabhathkota.pem;

location / {
proxy_pass http://127.0.0.1:80;
proxy_read_timeout 90;
proxy_connect_timeout 90;
proxy_redirect off;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
proxy_set_header X-Custom-Header nginx;

}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>