Custom X-Forwarded-* headers.

Started by oleg, March 11, 2024, 06:59:16 PM

Previous topic - Next topic
Cannot disable setting of special Forward headers for Nginx.

I'm talking about these ones:

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 $scheme;                                 
proxy_set_header X-Forwarded-Port $server_port;                             
proxy_set_header X-Forwarded-Host $host;



My goal is to set my own values, but i cannot override them, because any `proxy_set_header` direcitve which is set in `GUID_post/*.conf` just adds new header, not override it.

I already created a similar topic for the old OPNsense branch, but the discussion doesn't come up to some solution or workaround. That is why, I named the new topic with more general subject name.

I think it shouldn't be a too complex logic to create switch e.g. for the server/location which may disable automatic adding of that headers.

Original post:
Quotehttps://forum.opnsense.org/index.php?topic=37464.0