vhost: Add support for http basic auth
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
{% for header in location.headers | dict2items %}
|
||||
header {{ header.key }} `{{ header.value }}`
|
||||
{% endfor %}
|
||||
{% if location.basicauth %}
|
||||
basicauth {
|
||||
{% for user in location.basicauth_users | dict2items %}
|
||||
{{ user.key }} {{ user.value }}
|
||||
{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
{% if location.type == 'reverse_proxy' %}
|
||||
reverse_proxy {{ location.proxy_target_protocol }}://{{ location.proxy_target_host }}:{{ location.proxy_target_port }} {
|
||||
{% if location.proxy_target_protocol == 'https' and location.proxy_target_host == 'localhost' %}
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
'type': item.type | default(vhost_type),
|
||||
'headers': item.headers | default(vhost_headers),
|
||||
|
||||
'basicauth': item.basicauth | default(vhost_basicauth),
|
||||
'basicauth_users': item.basicauth_users | default(vhost_basicauth_users),
|
||||
|
||||
'proxy_target_port': item.proxy_target_port | default(proxy_target_port if vhost_type == 'reverse_proxy' else ''),
|
||||
'proxy_target_host': item.proxy_target_host | default(proxy_target_host),
|
||||
'proxy_target_protocol': item.proxy_target_protocol | default(proxy_target_protocol),
|
||||
|
||||
Reference in New Issue
Block a user