Setting expires header to multiple locations

howard chen howachen at
Fri Dec 14 14:38:16 UTC 2012


On Fri, Dec 14, 2012 at 7:59 PM, Antonio P.P. Almeida <appa at>wrote:

> Going against Igor, Maxim, Valentin and Ruslan in order to be more DRY you
> could use a regex based location (which has its own quirks):
> location ~* ^/(?:a|b|c)/.*\.(?:css|gif|js|jpe?g|png)$ {
>     expires 1y;
> }


My example just in a simplified form and there are more config inside each
a, b, c...So I must need separate blocks for them..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list