try_files and expires

rainer at rainer at
Tue Dec 8 14:34:28 UTC 2015


I have a case with a CMS (pimcore) and setting the expires directive.

     location / {
         # First attempt to serve request as file, then as directory, 
then fall back to index.php
         try_files $uri $uri/ /website/var/assets/$uri /index.php?$args;
         index index.php;

So, there are "assets" (pdfs, mostly but also some images) in a 

This works, but this directive:

     location ~* 
         access_log off;
         log_not_found off;

         expires 1w;

breaks the first directive.

Is there a way to have both?


More information about the nginx mailing list