View Single Post
  #2  
Old 27th April 2012, 13:05
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,715 Times in 2,557 Posts
Default

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
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote