Support for configuration of basic authentication (#99)
* Support for basic authentication
This commit is contained in:
parent
8db44bf979
commit
80f6157692
@ -344,6 +344,8 @@ nginx_http_template:
|
|||||||
html_file_location: /usr/share/nginx/html
|
html_file_location: /usr/share/nginx/html
|
||||||
html_file_name: index.html
|
html_file_name: index.html
|
||||||
autoindex: false
|
autoindex: false
|
||||||
|
auth_basic: null
|
||||||
|
auth_basic_file: null
|
||||||
http_demo_conf: false
|
http_demo_conf: false
|
||||||
reverse_proxy:
|
reverse_proxy:
|
||||||
locations:
|
locations:
|
||||||
@ -351,6 +353,8 @@ nginx_http_template:
|
|||||||
location: /
|
location: /
|
||||||
proxy_pass: http://backend
|
proxy_pass: http://backend
|
||||||
websocket: false
|
websocket: false
|
||||||
|
auth_basic: null
|
||||||
|
auth_basic_file: null
|
||||||
health_check_plus: false
|
health_check_plus: false
|
||||||
upstreams:
|
upstreams:
|
||||||
upstream1:
|
upstream1:
|
||||||
|
@ -175,6 +175,8 @@ nginx_http_template:
|
|||||||
html_file_location: /usr/share/nginx/html
|
html_file_location: /usr/share/nginx/html
|
||||||
html_file_name: index.html
|
html_file_name: index.html
|
||||||
autoindex: false
|
autoindex: false
|
||||||
|
auth_basic: null
|
||||||
|
auth_basic_file: null
|
||||||
http_demo_conf: false
|
http_demo_conf: false
|
||||||
reverse_proxy:
|
reverse_proxy:
|
||||||
locations:
|
locations:
|
||||||
@ -182,6 +184,8 @@ nginx_http_template:
|
|||||||
location: /
|
location: /
|
||||||
proxy_pass: http://backend
|
proxy_pass: http://backend
|
||||||
websocket: false
|
websocket: false
|
||||||
|
auth_basic: null
|
||||||
|
auth_basic_file: null
|
||||||
health_check_plus: false
|
health_check_plus: false
|
||||||
upstreams:
|
upstreams:
|
||||||
upstream1:
|
upstream1:
|
||||||
|
@ -33,6 +33,12 @@ server {
|
|||||||
{% if item.value.reverse_proxy is defined %}
|
{% if item.value.reverse_proxy is defined %}
|
||||||
{% for location in item.value.reverse_proxy.locations %}
|
{% for location in item.value.reverse_proxy.locations %}
|
||||||
location {{ item.value.reverse_proxy.locations[location].location }} {
|
location {{ item.value.reverse_proxy.locations[location].location }} {
|
||||||
|
{% if item.value.reverse_proxy.locations[location].auth_basic is defined and item.value.reverse_proxy.locations[location].auth_basic %}
|
||||||
|
auth_basic "{{ item.value.reverse_proxy.locations[location].auth_basic }}";
|
||||||
|
{% endif %}
|
||||||
|
{% if item.value.reverse_proxy.locations[location].auth_basic_file is defined and item.value.reverse_proxy.locations[location].auth_basic_file %}
|
||||||
|
auth_basic_user_file {{ item.value.reverse_proxy.locations[location].auth_basic_file }};
|
||||||
|
{% endif %}
|
||||||
proxy_pass {{ item.value.reverse_proxy.locations[location].proxy_pass }};
|
proxy_pass {{ item.value.reverse_proxy.locations[location].proxy_pass }};
|
||||||
{% if item.value.reverse_proxy.health_check_plus is defined and item.value.reverse_proxy.health_check_plus %}
|
{% if item.value.reverse_proxy.health_check_plus is defined and item.value.reverse_proxy.health_check_plus %}
|
||||||
health_check;
|
health_check;
|
||||||
@ -56,6 +62,12 @@ server {
|
|||||||
index {{ item.value.web_server.locations[location].html_file_name }};
|
index {{ item.value.web_server.locations[location].html_file_name }};
|
||||||
{% if item.value.web_server.locations[location].autoindex %}
|
{% if item.value.web_server.locations[location].autoindex %}
|
||||||
autoindex on;
|
autoindex on;
|
||||||
|
{% endif %}
|
||||||
|
{% if item.value.web_server.locations[location].auth_basic is defined and item.value.web_server.locations[location].auth_basic %}
|
||||||
|
auth_basic "{{ item.value.web_server.locations[location].auth_basic }}";
|
||||||
|
{% endif %}
|
||||||
|
{% if item.value.web_server.locations[location].auth_basic_file is defined and item.value.web_server.locations[location].auth_basic_file %}
|
||||||
|
auth_basic_user_file {{ item.value.web_server.locations[location].auth_basic_file }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user