From dde719baab7d2832d5c119f9dd61ce9189192d19 Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Thu, 26 May 2016 23:07:41 +0200 Subject: [PATCH] Handle private files Proposed config file was returning 404 for private files (ex. /system/files/foo.jpg) that are handled through Drupal. This snippet fixed it. --- source/start/topics/recipes/drupal.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/start/topics/recipes/drupal.rst b/source/start/topics/recipes/drupal.rst index 076e5706..dd131727 100644 --- a/source/start/topics/recipes/drupal.rst +++ b/source/start/topics/recipes/drupal.rst @@ -98,6 +98,11 @@ Recipe location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7 try_files $uri @rewrite; } + + # Handle private files through Drupal. + location ~ ^/system/files/ { # For Drupal >= 7 + try_files $uri /index.php?$query_string; + } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max;