mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-09 19:21:34 +08:00
added Drupal
This commit is contained in:
20
public/templates/conf/_drupal.conf.html
Normal file
20
public/templates/conf/_drupal.conf.html
Normal file
@@ -0,0 +1,20 @@
|
||||
# Drupal: deny private files
|
||||
location ~ ^/sites/.*/private/ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Drupal: deny php in files
|
||||
location ~ ^/sites/[^/]+/files/.*\.php$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Drupal: deny php in vendor
|
||||
location ~ /vendor/.*\.php$ {
|
||||
deny all;
|
||||
}<span ng-if="isLimitReq()">
|
||||
|
||||
# Drupal: throttle user functions
|
||||
location ~ ^/user/(?:login|register|password) {
|
||||
limit_req zone=login burst=2 nodelay;
|
||||
try_files $uri /index.php?$query_string;
|
||||
}</span>
|
@@ -1,34 +1,34 @@
|
||||
# allow tinymce
|
||||
# WordPress: allow TinyMCE
|
||||
location = /wp-includes/js/tinymce/wp-tinymce.php {
|
||||
include _php_fastcgi.conf;
|
||||
}
|
||||
|
||||
# wp-content, wp-includes php files
|
||||
# WordPress: deny wp-content, wp-includes php files
|
||||
location ~* ^/(?:wp-content|wp-includes)/.*\.php$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# wp-content/uploads nasty stuff
|
||||
# WordPress: deny wp-content/uploads nasty stuff
|
||||
location ~* ^/wp-content/uploads/.*\.(?:s?html?|php|js|swf)$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# wp-content/plugins nasty stuff
|
||||
# WordPress: deny wp-content/plugins nasty stuff
|
||||
location ~* ^/wp-content/plugins/.*\.(?!{{ extensions.assets }}|{{ extensions.fonts }}|{{ extensions.svg }}|{{ extensions.images }}|{{ extensions.audio }}|{{ extensions.video }}|{{ extensions.docs }}) {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# disable scripts and styles concat
|
||||
# WordPress: deny scripts and styles concat
|
||||
location ~* \/wp-admin\/load-(?:scripts|styles)\.php {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# WordPress stuff
|
||||
# WordPress: deny general stuff
|
||||
location ~* ^/(?:xmlrpc\.php|wp-links-opml\.php|wp-config\.php|wp-config-sample\.php|wp-comments-post\.php|readme\.html|license\.txt)$ {
|
||||
deny all;
|
||||
}<span ng-if="isLimitReq()">
|
||||
|
||||
# wp-login.php throttle
|
||||
# WordPress: throttle wp-login.php
|
||||
location = /wp-login.php {
|
||||
limit_req zone=login burst=2 nodelay;
|
||||
include _php_fastcgi.conf;
|
||||
|
@@ -80,7 +80,11 @@ server {<!--
|
||||
|
||||
✔ unified && ✔ WordPress --><span ng-if="isUnified() && isWordPress()">
|
||||
|
||||
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/_wordpress.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
|
||||
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/_wordpress.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
|
||||
|
||||
✔ unified && ✔ Drupal --><span ng-if="isUnified() && isDrupal()">
|
||||
|
||||
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/_drupal.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
|
||||
}<!--
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user