Maxim Dounin
September 15, 2014 09:26AM
Hello!

On Mon, Sep 15, 2014 at 09:11:37AM -0400, ianjoneill wrote:

> Hello,
>
> I am using nginx to proxy connections to a server I have written in Java,
> which serves connections on port 8080. I am trying to use the
> X-Forwarded-For header to identify the real IP address of a connection, but
> I am running into difficulties with the nginx setting real_ip_recursive.

[...]

> #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

[...]

> This proxies requests onto my server as I expect, but I do not receive the
> correct IP address in the X-Forwarded-For header. If I connect to the server
> from a different IP address, spoofing the X-Forwarded-For header, I do not
> get the IP address of the machine, but rather get the spoofed addresses.

In your configuration, "proxy_set_header X-Forwarded-For" is
commented out. Therefore, the X-Forwarded-For header is passed
unmodified to the backend.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx real_ip_recursive

ianjoneill September 15, 2014 09:11AM

Re: Nginx real_ip_recursive

Maxim Dounin September 15, 2014 09:26AM

Re: Nginx real_ip_recursive

ianjoneill September 15, 2014 09:41AM

Re: Nginx real_ip_recursive

Maxim Dounin September 15, 2014 11:14AM

Re: Nginx real_ip_recursive

ianjoneill September 15, 2014 11:41AM

Re: Nginx real_ip_recursive

Maxim Dounin September 15, 2014 03:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
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