diff --git a/templates/proxy_site.j2 b/templates/proxy_site.j2 index 4bca45f..db1cbe4 100644 --- a/templates/proxy_site.j2 +++ b/templates/proxy_site.j2 @@ -10,6 +10,16 @@ ### Configuration for: {{ item.key }} ################################################ +{% if proxy_site_dontlog_ips is defined %} +map $remote_addr $log_ip { +{% for item in proxy_site_dontlog_ips %} +"~{{ item }}" 1; +{% endfor %} +default 0; +} +{% endif %} + + server { listen 443 ssl; server_name {{ item.key }} {% if proxy_sites[item.key]['aliases'] is defined %}{{ proxy_sites[item.key]['aliases'] }}{% endif %}; @@ -22,16 +32,9 @@ server { ssl_prefer_server_ciphers on; {% if proxy_site_dontlog_ips is defined %} -map $remote_addr $log_ip { - {% for item in proxy_site_dontlog_ips %} - "~{{ item }}" 1; - {% endfor %} - default 0; - } - - access_log {{ proxy_site_log_path }}/{{ item.key }}.log if $log_ip; + access_log {{ proxy_site_log_path }}/{{ item.key }}.log main if=$log_ip; {% else %} -access_log {{ proxy_site_log_path }}/{{ item.key }}.log; +access_log {{ proxy_site_log_path }}/{{ item.key }}.log main; {% endif %} {% if proxy_sites[item.key]['max_upload'] is defined %}