Welcome! Log In Create A New Profile

Advanced

Re: inheritance of proxy_http_version and proxy_set_header

Francis Daly
May 09, 2018 04:26PM
On Wed, May 09, 2018 at 04:32:51AM -0700, Joe Doe wrote:

Hi there,

> I have many multiple mirrors for incoming request. To keep the config
> clean, I set:
> proxy_http_version 1.1;
> proxy_set_header "";
>
> in the http context. This worked for us (verified keep-alive is working),
> and it will inherit to all the mirror proxy_pass.

Those config directives (corrected) will inherit to any "location" which
does not have a "proxy_http_version" directive or a "proxy_set_header"
directive, respectively. (Assuming that neither are set at "server"
level either.)

> However, I recently added a mirror that used https, and I notice these
> settings no longer inherit to this mirror. At least keep-alive was not
> working. To address this, I had to add these 2 settings into the location
> specific to the mirror. (adding to the server context didn't work either)

Can you show the config that does not react the way that you want it to?

If you get the upstream (proxy_pass) server to "echo" the incoming
request, can you see what http version and http headers are sent by nginx?

> According to the documentation, these 2 settings can be in http, server and
> location context. And I assume if it's in http context, it would inherit to
> all the sub-blocks (and it did work for all the other http mirrors). Is
> this assumption incorrect and I should add these 2 settings to all the
> locations where I want to use keep-alive?

Directive inheritance follows the rules, or there is a bug. If these two
settings mean that keep-alive works for you, then you must make sure
that these two settings are in, or inherited into, each location that
you care about.

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

inheritance of proxy_http_version and proxy_set_header

Joe Doe May 09, 2018 07:34AM

Re: inheritance of proxy_http_version and proxy_set_header

Francis Daly May 09, 2018 04:26PM

Re: inheritance of proxy_http_version and proxy_set_header

Joe Doe May 12, 2018 02:20PM

Re: inheritance of proxy_http_version and proxy_set_header

Francis Daly May 15, 2018 05:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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