Commit 613f6bf7 authored by omega8cc's avatar omega8cc Committed by anarcat

Issue #1197172 - fix for private files and X-Accel-Redirect support in Nginx.

parent 69f94f67
......@@ -62,6 +62,20 @@
return 444;
}
###
### imagecache and imagecache_external support
###
location ~* /(?:external|system|files/imagecache|files/styles)/ {
access_log off;
expires 30d;
# fix common problems with old paths after import from standalone to Aegir multisite
rewrite ^/sites/(.*)/files/imagecache/(.*)/sites/default/files/(.*)$ /sites/$host/files/imagecache/$2/$3 last;
rewrite ^/files/imagecache/(.*)$ /sites/$host/files/imagecache/$1 last;
rewrite ^/files/styles/(.*)$ /sites/$host/files/styles/$1 last;
add_header X-Header "IC Generator 1.0";
try_files $uri @drupal;
}
###
### deny direct access to backups
###
......@@ -75,7 +89,7 @@
###
location ~* ^/sites/.*/private/ {
access_log off;
deny all;
internal;
}
###
......@@ -162,19 +176,6 @@
expires max; # max if using aggregator, otherwise sane expire time
}
###
### imagecache and imagecache_external support
###
location ~* /(?:external|system|files/imagecache|files/styles)/ {
access_log off;
expires 30d;
# fix common problems with old paths after import from standalone to Aegir multisite
rewrite ^/sites/(.*)/files/imagecache/(.*)/sites/default/files/(.*)$ /sites/$host/files/imagecache/$2/$3 last;
rewrite ^/files/imagecache/(.*)$ /sites/$host/files/imagecache/$1 last;
rewrite ^/files/styles/(.*)$ /sites/$host/files/styles/$1 last;
try_files $uri @drupal;
}
###
### serve & no-log static files & images directly, without all standard drupal rewrites, php-fpm etc.
###
......
......@@ -48,6 +48,20 @@
return 444;
}
###
### imagecache and imagecache_external support
###
location ~* /(?:external|system|files/imagecache|files/styles)/ {
access_log off;
expires 30d;
# fix common problems with old paths after import from standalone to Aegir multisite
rewrite ^/sites/(.*)/files/imagecache/(.*)/sites/default/files/(.*)$ /sites/$host/files/imagecache/$2/$3 last;
rewrite ^/files/imagecache/(.*)$ /sites/$host/files/imagecache/$1 last;
rewrite ^/files/styles/(.*)$ /sites/$host/files/styles/$1 last;
add_header X-Header "IC Generator 1.0";
try_files $uri @drupal;
}
###
### deny direct access to backups
###
......@@ -61,7 +75,7 @@
###
location ~* ^/sites/.*/private/ {
access_log off;
deny all;
internal;
}
###
......@@ -148,19 +162,6 @@
expires max; # max if using aggregator, otherwise sane expire time
}
###
### imagecache and imagecache_external support
###
location ~* /(?:external|system|files/imagecache|files/styles)/ {
access_log off;
expires 30d;
# fix common problems with old paths after import from standalone to Aegir multisite
rewrite ^/sites/(.*)/files/imagecache/(.*)/sites/default/files/(.*)$ /sites/$host/files/imagecache/$2/$3 last;
rewrite ^/files/imagecache/(.*)$ /sites/$host/files/imagecache/$1 last;
rewrite ^/files/styles/(.*)$ /sites/$host/files/styles/$1 last;
try_files $uri @drupal;
}
###
### serve & no-log static files & images directly, without all standard drupal rewrites, php-fpm etc.
###
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment