Try this in the nginx Directives field on the Options tab:
Code:
# Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
deny all;
}
location / {
if ($query_string ~ ".+") {
return 405;
}
# pass requests from logged-in users to Apache
if ($http_cookie ~ "DRUPAL_UID" ) {
return 405;
} # pass POST requests to Apache
if ($request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
error_page 405 = @nocache;
# do not allow browsers to cache HTML
add_header Expires "Sun, 19 Nov 1978 05:00:00 GMT";
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
# serve requested content from the cache if available, otherwise pass the request to Apache
try_files /cache/normal/$host/${uri}_.html /cache/perm/$host/${uri}_.css /cache/perm/$host/${uri}_.js /cache/$host/0$uri.html /cache/$host/0${uri}/index.html @nocache;
}
location @nocache {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}
(This configuration is for use with Drupal's Boost module.)
The configuration is based on this tutorial:
http://www.howtoforge.com/running-dr...e-ubuntu-11.04
Recent comments
11 hours 35 min ago
16 hours 34 min ago
18 hours 58 sec ago
18 hours 54 min ago
20 hours 37 min ago
1 day 1 hour ago
1 day 1 hour ago
1 day 4 hours ago
1 day 17 hours ago
1 day 18 hours ago