Welcome! Log In Create A New Profile

Advanced

Re: Are headers set in the server block inherited to all location blocks

Maxim Dounin
February 05, 2014 08:54AM
Hello!

On Wed, Feb 05, 2014 at 01:33:34PM +0000, Francis Daly wrote:

> On Wed, Feb 05, 2014 at 01:49:59AM -0500, justink101 wrote:
>
> Hi there,
>
> > I was under the impression that if you set headers in the
> > server block, ALL location blocks below inherit those headers.
>
> No.
>
> Can you say where you got that impression? Perhaps documentation can be
> clarified or corrected.

It looks like add_header documentation doesn't have our usual
clause for array-like directives, and something like this should
be helpful:

--- a/xml/en/docs/http/ngx_http_headers_module.xml
+++ b/xml/en/docs/http/ngx_http_headers_module.xml
@@ -56,6 +56,14 @@ the response code equals 200, 201, 204,
A value can contain variables.
</para>

+<para>
+There could be several <literal>add_header</literal> directives.
+These directives are inherited from the previous level if and
+only if there are no
+<literal>add_header</literal>
+directives defined on the current level.
+</para>
+
</directive>

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Are headers set in the server block inherited to all location blocks

justink101 February 05, 2014 01:49AM

Re: Are headers set in the server block inherited to all location blocks

Francis Daly February 05, 2014 08:34AM

Re: Are headers set in the server block inherited to all location blocks

Maxim Dounin February 05, 2014 08:54AM

Re: Are headers set in the server block inherited to all location blocks

Francis Daly February 05, 2014 10:12AM

Re: Are headers set in the server block inherited to all location blocks

Maxim Dounin February 05, 2014 11:44AM

Re: Are headers set in the server block inherited to all location blocks

justink101 February 05, 2014 10:55AM

Re: Are headers set in the server block inherited to all location blocks

itpp2012 February 05, 2014 01:51PM

Re: Are headers set in the server block inherited to all location blocks

Francis Daly February 05, 2014 07:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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