updated nginx state

This commit is contained in:
Paul 2023-03-31 17:40:53 +02:00
parent 5e3bdb132c
commit 4e33a24e6b

View File

@ -13,11 +13,20 @@ server {
root "{{ root_dir }}"; root "{{ root_dir }}";
{%- endif %} {%- endif %}
{%- if internal %} set $auth "Restricted Area";
{%- if internal and not auth %}
if ($allow = false) { if ($allow = false) {
return 403; return 403;
} }
{%- endif %} {%- endif %}
if ($allow = true) {
set $auth "off";
}
{%- if auth %}
auth_basic $auth;
auth_basic_user_file {{ config_dir }}/auth/htpasswd;
{%- endif %}
{%- for key,value in headers.items() %} {%- for key,value in headers.items() %}
add_header {{ key }} "{{ value }}"; add_header {{ key }} "{{ value }}";
@ -37,10 +46,6 @@ server {
{%- else %} {%- else %}
index index.html; index index.html;
{% endif %} {% endif %}
{%- if auth %}
auth_basic "Restricted area";
auth_basic_user_file {{ config_dir }}/auth/htpasswd;
{%- endif %}
} }
{%- for dir in dirs %} {%- for dir in dirs %}