Welcome! Log In Create A New Profile

Advanced

proxy_add_x_forwarded_for giving invalid IP address

proxy_add_x_forwarded_for giving invalid IP address
August 23, 2017 04:28AM
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;

}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 191
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready