Add more rules to Drupal conf (#146)

* add more rules - Drupal

* Update src/nginxconfig/generators/conf/drupal.conf.js

Co-authored-by: Matt (IPv4) Cowley <me@mattcowley.co.uk>

* Update src/nginxconfig/generators/conf/drupal.conf.js

Co-authored-by: Matt (IPv4) Cowley <me@mattcowley.co.uk>

* Update src/nginxconfig/generators/conf/drupal.conf.js

Co-authored-by: Matt (IPv4) Cowley <me@mattcowley.co.uk>

* fix rewrite when we can use try_files

* Update src/nginxconfig/generators/conf/drupal.conf.js

Co-authored-by: Matt (IPv4) Cowley <me@mattcowley.co.uk>

Co-authored-by: Matt (IPv4) Cowley <me@mattcowley.co.uk>
pull/159/head
Alexandre Dias 5 years ago committed by GitHub
parent 13b5220b93
commit 73c9bd8174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,8 +28,9 @@ 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'] = '';
@ -42,6 +43,11 @@ export default global => {
deny: 'all',
};
config['# Drupal: allow image styles to be handled by the CMS'] = '';
config['location ~ ^/sites/[^/]+/files/styles/'] = {
try_files: '$uri /index.php?q=$uri&$args',
};
config['# Drupal: handle private files'] = '';
config['location ~ ^(/[a-z\\-]+)?/system/files/'] = {
try_files: '$uri /index.php?$query_string',

Loading…
Cancel
Save