Welcome! Log In Create A New Profile

Advanced

Declare a block so as to be shared between locations

September 26, 2013 03:22AM
I have two locations, /a and /b . Both of them share these directives

expires max;
add_header Cache-Control public;
add_header ETag "";
break;

and location /b to has gzip_static on too.

Is there a way to write this without writing two times the common
directives?
That is, without rewriting the common directives like this:

location /a {
expires max;
add_header Cache-Control public;
add_header ETag "";
break;
}

location /b {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header ETag "";
break;
}

Generally speaking, is there a way to declare a block so as to be shared
between two or more locations without rewriting the common directives?

Thank you

--

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

Declare a block so as to be shared between locations

m.desantis September 26, 2013 03:22AM

Re: Declare a block so as to be shared between locations

GreenGecko September 26, 2013 03:26AM

Re: Declare a block so as to be shared between locations

mex September 26, 2013 04:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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