Skip to content

Commit 6d68779

Browse files
committed
Copy changes from nginx#587
1 parent ea7e337 commit 6d68779

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

templates/http/modules.j2

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,17 @@ log_format {{ format['name'] }}{{ (' escape=' + format['escape'] | string) if fo
187187
{% if log['access'] is defined and log['access'] is boolean and not log['access'] | bool %}
188188
access_log {{ 'off' }};
189189
{% elif log['access'] is defined %}
190-
{% for log in log['access'] %}
191-
access_log {{ 'off' if not log else log['path'] if log['path'] is defined }}{{ (' ' + log['format'] | string) if log['format'] is defined -}}
192-
{{- (' buffer=' + log['buffer'] | string) if log['buffer'] is defined -}}
193-
{{- ' 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 -}}
194-
{{- (' flush=' + log['flush'] | string) if log['flush'] is defined -}}
195-
{{- (' if=' + log['if']) if log['if'] is defined }};
190+
{% for access_item in log['access'] %}
191+
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 -}}
192+
{{- (' buffer=' + access_item['buffer'] | string) if access_item['buffer'] is defined -}}
193+
{{- ' 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 -}}
194+
{{- (' flush=' + access_item['flush'] | string) if access_item['flush'] is defined -}}
195+
{{- (' if=' + access_item['if']) if access_item['if'] is defined }};
196196
{% endfor %}
197197
{% endif %}
198198
{% if log['error'] is defined %}{# This does not belong here but we are making an exception #}
199-
{% for log in log['error'] if (log['error'] is not mapping and log['error'] is not string) %}
200-
error_log {{ log if log is string else log['file'] }}{{ (' ' + log['level'] | string) if log['level'] is defined }};
199+
{% for error_item in log['error'] if (log['error'] is not mapping and log['error'] is not string) %}
200+
error_log {{ error_item if error_item is string else error_item['file'] }}{{ (' ' + error_item['level'] | string) if error_item['level'] is defined }};
201201
{% else %}
202202
error_log {{ log['error'] if log['error'] is string else log['error']['file'] }}{{ (' ' + log['error']['level'] | string) if log['error']['level'] is defined }};
203203
{% endfor %}

0 commit comments

Comments
 (0)