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
17 hours 11 min ago
22 hours 9 min ago
23 hours 36 min ago
1 day 29 min ago
1 day 2 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 9 hours ago
1 day 22 hours ago
2 days 25 min ago