Posted by johntang on December 6, 2013 at 10:50am
Hello,
I'm using the right config from perusio, But images are missing from our site. It's show page not found 404. Until I comment code on drupal.conf, the problem has gone
## All static files will be served directly. ## location ~* ^.+\.(?:css|cur|js|jpg|jpeg|gif|htc|ico|png|html|xml)$ { ## access_log off; ## expires 30d; ## No need to bleed constant updates. Send the all shebang in one ## fell swoop. ## tcp_nodelay off; ## Set the OS file cache. ## open_file_cache max=3000 inactive=120s; ## open_file_cache_valid 45s; ## open_file_cache_min_uses 2; ## open_file_cache_errors off; ## }
I'm using the code for images styles
location ~* sites/.*/files/styles { log_not_found off; access_log off; expires 30d; try_files $uri @drupal; #reference from drupal.conf }
So, How I can fix this problem without remove code above?
Thanks
Comments
First
I do not have that regex based location in my config:
## Drupal 7 generated image handling, i.e., imagecache in core. See:
## http://drupal.org/node/371374.
location ~* /files/styles/ {
## Image hotlinking protection. If you want hotlinking
## protection for your images uncomment the following line.
#include apps/drupal/hotlinking_protection.conf;
access_log off;
expires 30d;
try_files $uri @drupal;
}
Second the reason it's not working is because you probably have another location that takes precedence over the one that you commented out.
Check the debug log to see which location is selected when you request an image.