On Tue, Dec 08, 2015 at 03:34:28PM +0100, rai...@ultra-secure.de wrote: Hi there,
> 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 > subdirectory. > > This works, but this directive: > > location ~* > \.(jpe?g|gif|png|bmp|ico|css|js|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|avi|mp\d)$ > { > access_log off; > log_not_found off; > > expires 1w; > } > > breaks the first 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? f -- Francis Daly fran...@daoine.org _______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx