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 }}";
{%- endif %}
{%- if internal %}
set $auth "Restricted Area";
{%- if internal and not auth %}
if ($allow = false) {
return 403;
}
{%- 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() %}
add_header {{ key }} "{{ value }}";
@ -37,10 +46,6 @@ server {
{%- else %}
index index.html;
{% endif %}
{%- if auth %}
auth_basic "Restricted area";
auth_basic_user_file {{ config_dir }}/auth/htpasswd;
{%- endif %}
}
{%- for dir in dirs %}