|
|
@@ -18,7 +18,6 @@ server {
|
|
|
access_log off;
|
|
|
}
|
|
|
|
|
|
- # Very rarely should these ever be accessed outside of your lan
|
|
|
location ~* \.(txt|log)$ {
|
|
|
allow 192.168.0.0/16;
|
|
|
deny all;
|
|
|
@@ -28,49 +27,42 @@ server {
|
|
|
return 403;
|
|
|
}
|
|
|
|
|
|
- # No no for private
|
|
|
location ~ ^/sites/.*/private/ {
|
|
|
return 403;
|
|
|
}
|
|
|
-
|
|
|
- # Block access to "hidden" files and directories whose names begin with a
|
|
|
- # period. This includes directories used by version control systems such
|
|
|
- # as Subversion or Git to store control files.
|
|
|
- location ~ (^|/)\. {
|
|
|
- return 403;
|
|
|
+
|
|
|
+ location ~ ^/sites/[^/]+/files/.*\.php$ {
|
|
|
+ deny all;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
location / {
|
|
|
- try_files $uri @rewrite;
|
|
|
+ try_files $uri /index.php?$query_string;
|
|
|
+ }
|
|
|
|
|
|
- location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
|
|
|
- expires max;
|
|
|
- }
|
|
|
+ location ~ /vendor/.*\.php$ {
|
|
|
+ deny all;
|
|
|
+ return 404;
|
|
|
+ }
|
|
|
|
|
|
- location ~ [^/]\.php(/|$)|^/update.php {
|
|
|
- fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
|
|
|
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
- if (!-f $document_root$fastcgi_script_name) {
|
|
|
- return 404;
|
|
|
- }
|
|
|
-
|
|
|
- fastcgi_pass %backend_lsnr%;
|
|
|
- fastcgi_index index.php;
|
|
|
- fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
|
- fastcgi_intercept_errors on;
|
|
|
- include /etc/nginx/fastcgi_params;
|
|
|
- }
|
|
|
+ location ~ ^/sites/.*/files/styles/ {
|
|
|
+ try_files $uri @rewrite;
|
|
|
}
|
|
|
|
|
|
- location @rewrite {
|
|
|
- # You have 2 options here
|
|
|
- # For D7 and above:
|
|
|
- # Clean URLs are handled in drupal_environment_initialize().
|
|
|
- rewrite ^ /index.php;
|
|
|
+ location ~ ^(/[a-z\-]+)?/system/files/ {
|
|
|
+ try_files $uri /index.php?$query_string;
|
|
|
}
|
|
|
|
|
|
- location ~ ^/sites/.*/files/styles/ {
|
|
|
+ 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;
|