Browse Source

Merge pull request #1683 from crackerizer/drupal-nginx

Reworked on Drupal's nginx template
Anton Reutov 7 years ago
parent
commit
90b30a437b
100 changed files with 4404 additions and 4980 deletions
  1. 43 53
      install/debian/7/templates/web/nginx/php5-fpm/drupal6.stpl
  2. 36 46
      install/debian/7/templates/web/nginx/php5-fpm/drupal6.tpl
  3. 46 52
      install/debian/7/templates/web/nginx/php5-fpm/drupal7.stpl
  4. 39 45
      install/debian/7/templates/web/nginx/php5-fpm/drupal7.tpl
  5. 53 54
      install/debian/7/templates/web/nginx/php5-fpm/drupal8.stpl
  6. 48 49
      install/debian/7/templates/web/nginx/php5-fpm/drupal8.tpl
  7. 43 53
      install/debian/8/templates/web/nginx/php5-fpm/drupal6.stpl
  8. 36 46
      install/debian/8/templates/web/nginx/php5-fpm/drupal6.tpl
  9. 46 52
      install/debian/8/templates/web/nginx/php5-fpm/drupal7.stpl
  10. 39 45
      install/debian/8/templates/web/nginx/php5-fpm/drupal7.tpl
  11. 53 54
      install/debian/8/templates/web/nginx/php5-fpm/drupal8.stpl
  12. 48 49
      install/debian/8/templates/web/nginx/php5-fpm/drupal8.tpl
  13. 43 53
      install/debian/9/templates/web/nginx/php-fpm/drupal6.stpl
  14. 36 46
      install/debian/9/templates/web/nginx/php-fpm/drupal6.tpl
  15. 46 52
      install/debian/9/templates/web/nginx/php-fpm/drupal7.stpl
  16. 39 45
      install/debian/9/templates/web/nginx/php-fpm/drupal7.tpl
  17. 53 54
      install/debian/9/templates/web/nginx/php-fpm/drupal8.stpl
  18. 48 49
      install/debian/9/templates/web/nginx/php-fpm/drupal8.tpl
  19. 43 53
      install/rhel/5/templates/web/nginx/php-fpm/drupal6.stpl
  20. 36 46
      install/rhel/5/templates/web/nginx/php-fpm/drupal6.tpl
  21. 46 52
      install/rhel/5/templates/web/nginx/php-fpm/drupal7.stpl
  22. 39 45
      install/rhel/5/templates/web/nginx/php-fpm/drupal7.tpl
  23. 53 54
      install/rhel/5/templates/web/nginx/php-fpm/drupal8.stpl
  24. 48 49
      install/rhel/5/templates/web/nginx/php-fpm/drupal8.tpl
  25. 43 53
      install/rhel/6/templates/web/nginx/php-fpm/drupal6.stpl
  26. 36 46
      install/rhel/6/templates/web/nginx/php-fpm/drupal6.tpl
  27. 46 52
      install/rhel/6/templates/web/nginx/php-fpm/drupal7.stpl
  28. 39 45
      install/rhel/6/templates/web/nginx/php-fpm/drupal7.tpl
  29. 53 54
      install/rhel/6/templates/web/nginx/php-fpm/drupal8.stpl
  30. 48 49
      install/rhel/6/templates/web/nginx/php-fpm/drupal8.tpl
  31. 43 53
      install/rhel/7/templates/web/nginx/php-fpm/drupal6.stpl
  32. 36 46
      install/rhel/7/templates/web/nginx/php-fpm/drupal6.tpl
  33. 46 52
      install/rhel/7/templates/web/nginx/php-fpm/drupal7.stpl
  34. 39 45
      install/rhel/7/templates/web/nginx/php-fpm/drupal7.tpl
  35. 53 54
      install/rhel/7/templates/web/nginx/php-fpm/drupal8.stpl
  36. 48 49
      install/rhel/7/templates/web/nginx/php-fpm/drupal8.tpl
  37. 43 53
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.stpl
  38. 36 46
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.tpl
  39. 46 52
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.stpl
  40. 39 45
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.tpl
  41. 53 54
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.stpl
  42. 48 49
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.tpl
  43. 43 53
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.stpl
  44. 36 46
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.tpl
  45. 46 52
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.stpl
  46. 39 45
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.tpl
  47. 53 54
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.stpl
  48. 48 49
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.tpl
  49. 43 53
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.stpl
  50. 36 46
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.tpl
  51. 46 52
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.stpl
  52. 39 45
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.tpl
  53. 53 54
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.stpl
  54. 48 49
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.tpl
  55. 43 53
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.stpl
  56. 36 46
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.tpl
  57. 46 52
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.stpl
  58. 39 45
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.tpl
  59. 53 54
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.stpl
  60. 48 49
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.tpl
  61. 43 53
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.stpl
  62. 36 46
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.tpl
  63. 46 52
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.stpl
  64. 39 45
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.tpl
  65. 53 54
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.stpl
  66. 48 49
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.tpl
  67. 43 53
      install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal6.stpl
  68. 36 46
      install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal6.tpl
  69. 46 52
      install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal7.stpl
  70. 39 45
      install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal7.tpl
  71. 53 54
      install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal8.stpl
  72. 48 49
      install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal8.tpl
  73. 43 53
      install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal6.stpl
  74. 36 46
      install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal6.tpl
  75. 46 52
      install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal7.stpl
  76. 39 45
      install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal7.tpl
  77. 53 54
      install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal8.stpl
  78. 48 49
      install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal8.tpl
  79. 43 53
      install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal6.stpl
  80. 36 46
      install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal6.tpl
  81. 46 52
      install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal7.stpl
  82. 39 45
      install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal7.tpl
  83. 53 54
      install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal8.stpl
  84. 48 49
      install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal8.tpl
  85. 43 53
      install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal6.stpl
  86. 36 46
      install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal6.tpl
  87. 46 52
      install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal7.stpl
  88. 39 45
      install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal7.tpl
  89. 53 54
      install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal8.stpl
  90. 48 49
      install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal8.tpl
  91. 43 53
      install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal6.stpl
  92. 36 46
      install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal6.tpl
  93. 46 52
      install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal7.stpl
  94. 39 45
      install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal7.tpl
  95. 53 54
      install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal8.stpl
  96. 48 49
      install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal8.tpl
  97. 43 53
      install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal6.stpl
  98. 36 46
      install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal6.tpl
  99. 46 52
      install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal7.stpl
  100. 39 45
      install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal7.tpl

+ 43 - 53
install/debian/7/templates/web/nginx/php5-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/debian/7/templates/web/nginx/php5-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/debian/7/templates/web/nginx/php5-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/debian/7/templates/web/nginx/php5-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/debian/7/templates/web/nginx/php5-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/debian/7/templates/web/nginx/php5-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/debian/8/templates/web/nginx/php5-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/debian/8/templates/web/nginx/php5-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/debian/8/templates/web/nginx/php5-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/debian/8/templates/web/nginx/php5-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/debian/8/templates/web/nginx/php5-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/debian/8/templates/web/nginx/php5-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/debian/9/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/debian/9/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/debian/9/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/debian/9/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/debian/9/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/debian/9/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/rhel/5/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/rhel/5/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/rhel/5/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/rhel/5/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/rhel/5/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/rhel/5/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/rhel/6/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/rhel/6/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/rhel/6/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/rhel/6/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/rhel/6/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/rhel/6/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/rhel/7/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/rhel/7/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/rhel/7/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/rhel/7/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/rhel/7/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/rhel/7/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/14.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/15.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/15.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/16.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

+ 53 - 54
install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -11,63 +11,62 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
+   
     location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-    
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }    
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 48 - 49
install/ubuntu/16.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -7,63 +7,62 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
+    }  
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ \..*/.*\.php$ {
+            return 403;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
+        location ~ /vendor/.*\.php$ {
+            deny all;
+            return 404;
+        }          
+        
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
-    }
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
+    }        
 
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;

+ 43 - 53
install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -10,63 +10,53 @@ server {
     ssl         on;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
-
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
-        try_files $uri @rewrite;
-    }
-
+   
     location @rewrite {
         rewrite ^/(.*)$ /index.php?q=$1;
-    }
-    
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
-
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
-
-    location ~ ^/sites/.*/files/imagecache/ {
+    }   
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
+        
         try_files $uri @rewrite;
-    }    
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }    
+
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 36 - 46
install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -7,62 +7,52 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
         }
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location / {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
 
-    location @rewrite {
-        rewrite ^/(.*)$ /index.php?q=$1;
-    }
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }    
+        try_files $uri @rewrite; 
 
-    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ ^/sites/.*/files/imagecache/ {
-        try_files $uri @rewrite;
-    }
-        
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;             
-        include /etc/nginx/fastcgi_params;
+        location ~ ^/sites/.*/files/imagecache/ {
+            try_files $uri @rewrite;
+        }
+            
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;             
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 46 - 52
install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -11,62 +11,56 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
-    }
-
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
-
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
-
-    location ~ \..*/.*\.php$ {
-        return 403;
-    }
-
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
     
     location / {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
-
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
-
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
-
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
+
+        location ~ ^/sites/.*/private/ {
+            return 403;
+        }
+
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }
     
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        try_files $uri /index.php?$query_string;  
+
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
+
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
+
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
+        
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }        
     }
 
     error_page  403 /error/404.html;

+ 39 - 45
install/ubuntu/17.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -7,62 +7,56 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
-    location = /favicon.ico {
-        log_not_found off;
-        access_log off;
+    location @rewrite {
+        rewrite ^/(.*)$ /index.php?q=$1;
     }
+   
+    location / {
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
 
-    location = /robots.txt {
-        allow all;
-        log_not_found off;
-        access_log off;
-    }
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
 
-    location ~* \.(txt|log)$ {
-        allow 192.168.0.0/16;
-        deny all;
-    }
+        location ~ \..*/.*\.php$ {
+            return 403;
+        }
 
-    location ~ \..*/.*\.php$ {
-        return 403;
+        location ~ ^/sites/.*/private/ {
+            return 403;
         }
+        
+        location ~ ^/sites/[^/]+/files/.*\.php$ {
+            deny all;
+        }  
 
-    location ~ ^/sites/.*/private/ {
-        return 403;
-    }
-    
-    location ~ ^/sites/[^/]+/files/.*\.php$ {
-        deny all;
-    }
-    
-    location / {
         try_files $uri /index.php?$query_string;
-    }
-
-    location ~ /vendor/.*\.php$ {
-        deny all;
-        return 404;
-    }        
 
-    location ~ ^/sites/.*/files/styles/ {
-        try_files $uri @rewrite;
-    }
+        location ~ ^/sites/.*/files/styles/ {
+            try_files $uri @rewrite;
+        }
 
-    location ~ ^(/[a-z\-]+)?/system/files/ {
-        try_files $uri /index.php?$query_string;
-    }
+        location ~ ^(/[a-z\-]+)?/system/files/ {
+            try_files $uri /index.php?$query_string;
+        }
 
-    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
-        try_files $uri @rewrite;
-        expires max;
-        log_not_found off;
-    }
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+            try_files $uri @rewrite;
+            expires max;
+            log_not_found off;
+        }
 
-    location ~ '\.php$|^/update.php' {
-        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-        fastcgi_pass %backend_lsnr%;
-        include         /etc/nginx/fastcgi_params;
+        location ~ '\.php$|^/update.php' {
+            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            fastcgi_pass %backend_lsnr%;
+            include /etc/nginx/fastcgi_params;
+        }                
     }
 
     error_page  403 /error/404.html;

Some files were not shown because too many files changed in this diff