updated nginx state

This commit is contained in:
Paul 2022-04-18 21:24:56 +02:00
parent 73c608fff6
commit 3daa0477b6
2 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,7 @@ nginx-sites-available-{{ key }}:
- service: nginx-service - service: nginx-service
- context: - context:
vhost_name: {{ vhost.name }} vhost_name: {{ vhost.name }}
config_dir: {{ nginx.config.dir }}
https: {{ vhost.https|default(true) }} https: {{ vhost.https|default(true) }}
proxy: {{ vhost.proxy|default(false) }} proxy: {{ vhost.proxy|default(false) }}
proxy_pass: {{ vhost.proxy_pass|default("") }} proxy_pass: {{ vhost.proxy_pass|default("") }}
@ -53,6 +54,7 @@ nginx-sites-available-{{ key }}:
autoindex: {{ vhost.autoindex|default(false) }} autoindex: {{ vhost.autoindex|default(false) }}
root_dir: {{ vhost.root_dir|default(none) }} root_dir: {{ vhost.root_dir|default(none) }}
internal_access: {{ vhost.internal_access|default(false) }} internal_access: {{ vhost.internal_access|default(false) }}
auth: {{ vhost.auth|default(false) }}
dirs: {{ vhost.dirs|default([]) }} dirs: {{ vhost.dirs|default([]) }}
php_socket_file: {{ nginx.config.php_socket_file }} php_socket_file: {{ nginx.config.php_socket_file }}

View File

@ -29,6 +29,10 @@ server {
{%- else %} {%- else %}
index index.html index.rss; index index.html index.rss;
{% 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 %}