Add basic auth and ignore backend SSL errors
This commit is contained in:
parent
7677bc25fa
commit
85a6c3894a
@ -3,6 +3,7 @@ network_type: static
|
|||||||
allow_reboot: true
|
allow_reboot: true
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
- apache2-utils
|
||||||
- cryptsetup
|
- cryptsetup
|
||||||
- curl
|
- curl
|
||||||
- dnsutils
|
- dnsutils
|
||||||
|
@ -28,9 +28,16 @@ server {
|
|||||||
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
location / {
|
location / {
|
||||||
|
{% if item.restrict is defined and item.restrict %}
|
||||||
|
auth_basic "{{ item.restrict_name | default('Restricted Access') }}";
|
||||||
|
auth_basic_user_file {{ item.restrict_file | default('/etc/nginx/.htpasswd') }};
|
||||||
|
{% endif %}
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass {{ item.proxy_pass }};
|
proxy_pass {{ item.proxy_pass }};
|
||||||
|
{% if item.proxy_ssl_verify is defined and item.proxy_ssl_verify is false %}
|
||||||
|
proxy_ssl_verify off;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user