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
parent
13b5220b93
commit
73c9bd8174
|
@ -28,8 +28,9 @@ export default global => {
|
||||||
const config = {};
|
const config = {};
|
||||||
|
|
||||||
config['# Drupal: deny private files'] = '';
|
config['# Drupal: deny private files'] = '';
|
||||||
config['location ~ ^/sites/.*/private/'] = {
|
config['location ~ ((^|/)\.|^.*\.yml$|^/sites/.*/private/|^/sites/[^/]+/[^/]*settings.*\.php$)'] = {
|
||||||
deny: 'all',
|
deny: 'all',
|
||||||
|
return: '404',
|
||||||
};
|
};
|
||||||
|
|
||||||
config['# Drupal: deny php in files'] = '';
|
config['# Drupal: deny php in files'] = '';
|
||||||
|
@ -42,6 +43,11 @@ export default global => {
|
||||||
deny: 'all',
|
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['# Drupal: handle private files'] = '';
|
||||||
config['location ~ ^(/[a-z\\-]+)?/system/files/'] = {
|
config['location ~ ^(/[a-z\\-]+)?/system/files/'] = {
|
||||||
try_files: '$uri /index.php?$query_string',
|
try_files: '$uri /index.php?$query_string',
|
||||||
|
|
Loading…
Reference in New Issue