mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-11 14:34:06 +08:00
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>
This commit is contained in:
@@ -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',
|
||||
|
Reference in New Issue
Block a user