Welcome! Log In Create A New Profile

Advanced

Usage of $proxy_add_x_forwarded_for on edge proxies

nanaya
January 12, 2021 09:16AM
Should there be warning in documentation on usage of $proxy_add_x_forwarded_for for X-Forwarded-For proxy header on edge proxies?

I keep seeing config examples with proxy settings like this:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Which doesn't make sense on edge servers as there's no way to trust the client-provided value. At best it just adds unnecessary complexity trying to figure out the last "trustworthy" entry.

The correct value should be just $remote_addr (and thus drop client-provided values).

I think $proxy_add_x_forwarded_for should only be used for proxies located behind another proxy.

(or someone please correct me on this)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Usage of $proxy_add_x_forwarded_for on edge proxies

nanaya January 12, 2021 09:16AM

Re: Usage of $proxy_add_x_forwarded_for on edge proxies

Maxim Dounin January 12, 2021 12:48PM

Re: Usage of $proxy_add_x_forwarded_for on edge proxies

nanaya January 12, 2021 04:52PM

Re: Usage of $proxy_add_x_forwarded_for on edge proxies

Maxim Dounin January 13, 2021 08:54AM

Re: Usage of $proxy_add_x_forwarded_for on edge proxies

nanaya January 13, 2021 09:40AM

Re: Usage of $proxy_add_x_forwarded_for on edge proxies

Maxim Dounin January 13, 2021 12:46PM

Re: Usage of $proxy_add_x_forwarded_for on edge proxies

nanaya January 13, 2021 02:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready