simple auth question for nested sections

B.R. reallfqq-nginx at
Thu Mar 24 17:17:44 UTC 2016

I guess the docs logic is reversed: it is explicitely stated when a
directive inherits, which must be that way because not considered the
default behavior (although I am not in Igor's head...).

This product uses a different paradigm that 'minimal configuration lines',
and Igor has nothing against duplicated blocks, which allow direct
understanding of what is in effect in the location block you are looking
at, compared to horizontal/similar ones (ofc server-wide directives shall
not and won't be redeclared at location level).
In the modern world, use of configuration management tools, which allow
templating, allows duplicated stanzas without trouble on configuration

That is a way of looking at configuration, and everyone has his/her views
on it.
Please, correct me if I am wrong.
*B. R.*

On Thu, Mar 24, 2016 at 12:56 AM, Jonathan Vanasco <nginx at> wrote:

> On Mar 23, 2016, at 2:14 PM, Francis Daly wrote:
> Any directives that inherit do not need to be repeated.
> If it does not work for you, that's probably due to proxy_pass not
> inheriting.
> Thanks - that's it -- `proxy_pass` does not inherit, but all the
> `proxy_set_header` directives in that block do.
> Only the `proxy_pass` directive needed to be repeated in the location
> block (thank goodness!)
> location /foo {
> proxy_pass;
> # nearly 10 lines of proxy_set_header
> ...
> location /foo/admin {
> proxy_pass;
> auth_basic "Administrator Login";
> auth_basic_user_file /etc/nginx/_htpasswd/foo;
> }
> }
> On Mar 23, 2016, at 7:20 AM, B.R. wrote:
> Why would you want to do that? Spaghetti configuration?
> The proxy has a dozen lines of configuration.
> The `proxy_pass` line doesn't inherit, but the docs don't mention that.
> Only the `proxy_pass` directive not inheriting was the last thing I
> expected.  So I had to run duplicate blocks until things worked.
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list