Commits

Jon Langevin committed 6817992

Added Drupal 6 config w/ rewrites.
Made tweaks to _common & _php configs

  • Participants
  • Parent commits 3e67753

Comments (0)

Files changed (3)

File .skel/vhost-default/conf/_common.conf

                 deny  all;
         }
 
+        location = /favicon.ico {
+                log_not_found off;
+                access_log off;
+        }
+
+        location = /robots.txt {
+                allow all;
+                log_not_found off;
+                access_log off;
+        }
+
+        # Very rarely should these ever be accessed outside of your lan
+        location ~* \.(txt|log)$ {
+                allow 192.168.0.0/16;
+                deny all;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
+                expires max;
+                log_not_found off;
+        }
+
         # Basic PHP config
         #include VHOSTDIR/DOMAIN/conf/_php.conf;
 

File .skel/vhost-default/conf/_php.conf

                 fastcgi_pass 127.0.0.1:9000;
                 include fastcgi_params;
         }
+
+        location ~ \..*/.*\.php$ {
+                return 403;
+        }

File .skel/vhost-default/conf/apps/drupal6.conf

+        # This matters if you use drush
+        location = /backup {
+                deny all;
+        }
+
+        location / {
+                # This is cool because no php is touched for static content
+                try_files $uri $uri/ @rewrite;
+        }
+
+        location @rewrite {
+                # Some modules enforce no slash (/) at the end of the URL
+                # Else this rewrite block wouldn't be needed (GlobalRedirect)
+                rewrite ^/(.*)$ /index.php?q=$1;
+        }
+
+        # Fighting with ImageCache? This little gem is amazing.
+        location ~ ^/sites/.*/files/imagecache/ {
+                try_files $uri $uri/ @rewrite;
+        }