Mastering Nginx

(Ron) #1
Chapter 6

[ 147 ]

# For not signaling a 404 in the error log whenever the
# system/files directory is accessed add the line below.
# Note that the 404 is the intended behavior.
log_not_found off;

}

# Trying to access private files directly returns a 404.
location ^~ /sites/default/files/private/ {
internal;
}

## (Drupal 6) If accessing an image generated by imagecache,
## serve it directly if available, if not relay the request to
# Drupal
## to (re)generate the image.
location ~* /imagecache/ {

access_log off;

expires 30d;

try_files $uri /index.php?q=$no_slash_uri&$args;

}

# Drupal 7 image handling, i.e., imagecache in core
location ~* /files/styles/ {

access_log off;

expires 30d;

try_files $uri @drupal;

}

The Advanced Aggregation module configuration coming up next differs only


in the location used. The Advanced Aggregation module configuration for CSS
is as follows:


# Advanced Aggregation module CSS support.
location ^~ /sites/default/files/advagg_css/ {
Free download pdf