Try_files and expires


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?


On Tue, Dec 08, 2015 at 03:34:28PM +0100, [email protected] wrote:

Hi there,

This works, but this directive:

Is there a way to have both?

One request is handled in one location. Put the configuration that you
want, in the location that is matched.

It is not immediately clear to me what response you want for a request
for /one.pdf.

Perhaps add the try_files to the regex location?


Francis D. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs