bundles/nginx: enable creating logs for debugging purposes

This commit is contained in:
Franzi 2023-09-01 05:53:37 +02:00
parent 553ed05ba2
commit b01dcb0ff9
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 6 additions and 3 deletions

View file

@ -54,13 +54,16 @@ server {
resolver 8.8.8.8 8.8.4.4 valid=300s; resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s; resolver_timeout 5s;
% if create_access_log: % if create_logs:
access_log /var/log/nginx/access-${vhost}.log gdpr; 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 % endif
% if create_timing_log: % if create_timing_log:
access_log /var/log/nginx-timing/${vhost}.log anon_timing; access_log /var/log/nginx-timing/${vhost}.log anon_timing;
% endif % endif
# error_log is disabled globally
% if max_body_size: % if max_body_size:
client_max_body_size ${max_body_size}; client_max_body_size ${max_body_size};

View file

@ -125,7 +125,7 @@ for vhost, config in node.metadata.get('nginx/vhosts', {}).items():
'source': 'site_template', 'source': 'site_template',
'content_type': 'mako', 'content_type': 'mako',
'context': { '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), 'create_timing_log': config.get('timing_log', True),
'php_version': node.metadata.get('php/version', ''), 'php_version': node.metadata.get('php/version', ''),
'security_txt': security_txt_enabled, 'security_txt': security_txt_enabled,