added support for includes and auths, extended docu
This commit is contained in:
parent
b1b10fad9b
commit
1ec6fbb1fd
8 changed files with 58 additions and 7 deletions
|
|
@ -32,7 +32,7 @@ server {
|
|||
proxy_pass {{ vhost.backend }};
|
||||
|
||||
# add proxy headers
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Host {% if 'host' in vhost %}"{{ vhost.host }}"{% else %}$host{% endif %};
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
|
@ -61,8 +61,19 @@ server {
|
|||
}
|
||||
{% endfor %}
|
||||
|
||||
{% if vhost.auth.enable|default(False) %}
|
||||
auth_basic "restricted area";
|
||||
auth_basic_user_file {{ vhost.auth.path }};
|
||||
satisfy {{ vhost.auth.satisfy|d('all') }};
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% for include in vhost.includes|default([]) %}
|
||||
include {{ include }};
|
||||
{% endfor %}
|
||||
|
||||
{% if vhost.letsencrypt|d(False) %}
|
||||
ssl_certificate /etc/ssl/nginx_{{ vhost_name }}.chain.crt;
|
||||
ssl_certificate_key /etc/ssl/private/nginx_{{ vhost_name }}.key;
|
||||
ssl_certificate /etc/ssl/nginx_{{ vhost_name }}.chain.crt;
|
||||
ssl_certificate_key /etc/ssl/private/nginx_{{ vhost_name }}.key;
|
||||
{% endif %}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue