Welcome! Log In Create A New Profile

Advanced

Re: proxy_set_header on HTTP or Server level

Francis Daly
August 30, 2019 04:26PM
On Fri, Aug 30, 2019 at 01:03:57PM -0400, stmx38 wrote:

Hi there,

> As per documentation -
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header:
> Context: http, server, location
>
> > These directives are inherited from the previous level if and only if
> there are no proxy_set_header directives defined on the current level.

> Does it mean that if at least one of the proxy_set_header is defined on
> location level we should define all other on this level because it broke
> inheritance?

Yes, that is what it means.

The request is handled in a location{}, with proxy_pass.

If there is any proxy_set_header in that location{}, then only those
proxy_set_header values are used.

If not, then if there is any proxy_set_header in the surrounding server{},
then only those proxy_set_header values are used.

If not, then if there is any proxy_set_header in the surrounding http{},
then only those proxy_set_header values are used.

In the same way, if "proxy_busy_buffers_size" is set in the location{},
that value is used; if not, if "proxy_busy_buffers_size" is set in the
server{}, that value is used; if not, if "proxy_busy_buffers_size" is set
in http{}, that value is used.


In general in nginx (with a few exceptions) directive inheritance is
"not at all", or "by replacement".

> Per our experience, these directives only work on location level. They do
> not apply when we set them up on HTTP or Server level.
>
> Why may be wrong with our configuration?

Can you show a sample configuration, if there is a problem?

But if it has "proxy_set_header" in the location{}, then any
proxy_set_header outside that location is irrelevant for this request.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_set_header on HTTP or Server level

stmx38 August 30, 2019 01:03PM

Re: proxy_set_header on HTTP or Server level

Francis Daly August 30, 2019 04:26PM

Re: proxy_set_header on HTTP or Server level

stmx38 December 05, 2019 12:59PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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