diff --git a/tasks/config/upload-config.yml b/tasks/config/upload-config.yml index 9a18b1b6..2c2753a9 100644 --- a/tasks/config/upload-config.yml +++ b/tasks/config/upload-config.yml @@ -52,7 +52,7 @@ src: "{{ item['src'] }}" dest: "{{ item['dest'] | default('/etc/ssl/certs') }}" backup: "{{ item['backup'] | default(true) }}" - mode: "0640" + mode: "0644" loop: "{{ nginx_config_upload_ssl_crt }}" notify: (Handler - NGINX Config) Run NGINX diff --git a/templates/http/modules.j2 b/templates/http/modules.j2 index 1efc1e6d..634f670d 100644 --- a/templates/http/modules.j2 +++ b/templates/http/modules.j2 @@ -187,17 +187,17 @@ log_format {{ format['name'] }}{{ (' escape=' + format['escape'] | string) if fo {% if log['access'] is defined and log['access'] is boolean and not log['access'] | bool %} access_log {{ 'off' }}; {% elif log['access'] is defined %} -{% for log in log['access'] %} -access_log {{ 'off' if not log else log['path'] if log['path'] is defined }}{{ (' ' + log['format'] | string) if log['format'] is defined -}} -{{- (' buffer=' + log['buffer'] | string) if log['buffer'] is defined -}} -{{- ' gzip' if log['gzip'] is defined and log['access']['gzip'] is boolean and log['gzip'] | bool else (' gzip=' + log['gzip'] | string) if log['gzip'] is defined and log['gzip'] is string -}} -{{- (' flush=' + log['flush'] | string) if log['flush'] is defined -}} -{{- (' if=' + log['if']) if log['if'] is defined }}; +{% for access_item in log['access'] %} +access_log {{ 'off' if not access_item else access_item['path'] if access_item['path'] is defined }}{{ (' ' + access_item['format'] | string) if access_item['format'] is defined -}} +{{- (' buffer=' + access_item['buffer'] | string) if access_item['buffer'] is defined -}} +{{- ' gzip' if access_item['gzip'] is defined and access_item['gzip'] is boolean and access_item['gzip'] | bool else (' gzip=' + access_item['gzip'] | string) if access_item['gzip'] is defined -}} +{{- (' flush=' + access_item['flush'] | string) if access_item['flush'] is defined -}} +{{- (' if=' + access_item['if']) if access_item['if'] is defined }}; {% endfor %} {% endif %} {% if log['error'] is defined %}{# This does not belong here but we are making an exception #} -{% for log in log['error'] if (log['error'] is not mapping and log['error'] is not string) %} -error_log {{ log if log is string else log['file'] }}{{ (' ' + log['level'] | string) if log['level'] is defined }}; +{% for error_item in log['error'] if (log['error'] is not mapping and log['error'] is not string) %} +error_log {{ error_item if error_item is string else error_item['file'] }}{{ (' ' + error_item['level'] | string) if error_item['level'] is defined }}; {% else %} error_log {{ log['error'] if log['error'] is string else log['error']['file'] }}{{ (' ' + log['error']['level'] | string) if log['error']['level'] is defined }}; {% endfor %}