diff --git a/bundles/nginx/files/site_template b/bundles/nginx/files/site_template index a3271e3..fdd5279 100644 --- a/bundles/nginx/files/site_template +++ b/bundles/nginx/files/site_template @@ -54,13 +54,16 @@ server { resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 5s; -% if create_access_log: +% if create_logs: access_log /var/log/nginx/access-${vhost}.log gdpr; + error_log /var/log/nginx/error-${vhost}.log; +% else: + # regular access_log is disabled + # error_log is disabled % endif % if create_timing_log: access_log /var/log/nginx-timing/${vhost}.log anon_timing; % endif - # error_log is disabled globally % if max_body_size: client_max_body_size ${max_body_size}; diff --git a/bundles/nginx/items.py b/bundles/nginx/items.py index 4663f92..2de11db 100644 --- a/bundles/nginx/items.py +++ b/bundles/nginx/items.py @@ -125,7 +125,7 @@ for vhost, config in node.metadata.get('nginx/vhosts', {}).items(): 'source': 'site_template', 'content_type': 'mako', 'context': { - 'create_access_log': config.get('access_log', node.metadata.get('nginx/access_log', False)), + 'create_logs': config.get('create_logs', False), 'create_timing_log': config.get('timing_log', True), 'php_version': node.metadata.get('php/version', ''), 'security_txt': security_txt_enabled,