add more rules - Drupal
parent
2dcc2fc4ba
commit
6bb84177b9
|
@ -1,25 +1,34 @@
|
||||||
# Drupal: deny private files
|
# Drupal: deny private files
|
||||||
location ~ ^/sites/.*/private/ {
|
location ~ ((^|/)\.|^.*\.yml$|^/sites/.*/private/|^/sites/[^/]+/.*settings.*\.php$) {
|
||||||
deny all;
|
deny all;
|
||||||
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Drupal: deny php in files
|
# Drupal: deny php in files
|
||||||
location ~ ^/sites/[^/]+/files/.*\.php$ {
|
location ~ ^/sites/[^/]+/files/.*\.php$ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Drupal: deny php in vendor
|
# Drupal: deny php in vendor
|
||||||
location ~ /vendor/.*\.php$ {
|
location ~ /vendor/.*\.php$ {
|
||||||
deny all;
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow image styles to be handled by the CMS.
|
||||||
|
location ~ ^/sites/[^/]+/files/styles/ {
|
||||||
|
try_files $uri @rewrite;
|
||||||
|
}
|
||||||
|
location @rewrite {
|
||||||
|
rewrite ^/(.*)$ /index.php?q=$1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Drupal: handle private files
|
# Drupal: handle private files
|
||||||
location ~ ^(/[a-z\-]+)?/system/files/ {
|
location ~ ^(/[a-z\-]+)?/system/files/ {
|
||||||
try_files $uri /index.php?$query_string;
|
try_files $uri /index.php?$query_string;
|
||||||
}<span ng-if="isLimitReq()">
|
}<span ng-if="isLimitReq()">
|
||||||
|
|
||||||
# Drupal: throttle user functions
|
# Drupal: throttle user functions
|
||||||
location ~ ^/user/(?:login|register|password) {
|
location ~ ^/user/(?:login|register|password) {
|
||||||
limit_req zone=login burst=2 nodelay;
|
limit_req zone=login burst=2 nodelay;
|
||||||
try_files $uri /index.php?$query_string;
|
try_files $uri /index.php?$query_string;
|
||||||
}</span>
|
}</span>
|
||||||
|
|
Loading…
Reference in New Issue