add more rules - Drupal

pull/146/head
Alexandre Dias 2020-06-03 21:51:29 +01:00
parent 1d2362023c
commit 3e92a289de
1 changed files with 12 additions and 1 deletions

View File

@ -18,8 +18,10 @@ export default global => {
const config = {};
config['# Drupal: deny private files'] = '';
config['location ~ ^/sites/.*/private/'] = {
config['location ~ ((^|/)\.|^.*\.yml$|^/sites/.*/private/|^/sites/[^/]+/.*settings.*\.php$)'] = {
deny: 'all',
return: '404',
};
config['# Drupal: deny php in files'] = '';
@ -32,6 +34,15 @@ export default global => {
deny: 'all',
};
config['# Allow image styles to be handled by the CMS.'] = '';
config['location ~ ^/sites/[^/]+/files/styles/'] = {
try_files: '$uri @rewrite',
};
config['location @rewrite'] = {
rewrite: '^/(.*)$ /index.php?q=$1',
};
config['# Drupal: handle private files'] = '';
config['location ~ ^(/[a-z\\-]+)?/system/files/'] = {
try_files: '$uri /index.php?$query_string',