if the imagecached images are already generated then it work fine, but with the following configuration, imagecache is unable to generate the imagecache versions
location ~ \.(jpg|png|gif)$ {
valid_referers server_names;
if ($invalid_referer) {
return 403;
}
}
is there another way to do this?
or does the imacache code need to be modified?
maybe another test in this code to allow imagecache to do its thing?
###FIXED###
for reference purposes:
the above 'location' statement needed to be within another 'location' statement later in the same configuration file
this one was blocking the latter from rewrites that imagecache needed
###
### Serve & no-log static files & images directly,
### without all standard drupal rewrites, php-fpm etc.
###
location ~* ^.+\.(?:jpe?g|gif|png|ico|bmp|svg|swf|pdf|docx?|xlsx?|pptx?|tiff?|txt|rtf|cgi|bat|pl|dll|aspx?|exe|class|otf|ttf|woff)$ {
+ valid_referers server_names;
+ if ($invalid_referer) {
+ return 403;
+ }
access_log off;
tcp_nodelay off;
expires 30d;
# allow files/images/downloads to be accessed without /sites/fqdn/
rewrite ^/files/(.*)$ /sites/$host/files/$1 last;
rewrite ^/images/(.*)$ /sites/$host/files/images/$1 last;
rewrite ^/downloads/(.*)$ /sites/$host/files/downloads/$1 last;
rewrite ^/.+/sites/.+/files/(.*)$ /sites/$host/files/$1 last;
try_files $uri =404;
}
Comments
Comment #0.0
Lowell commentedfixed and documented
Comment #1
sandrewj commentedComment #1.0
sandrewj commentedadded more info