add basic auth

This commit is contained in:
weeman 2021-09-23 23:29:40 +02:00
parent 378351e430
commit efe277db2a
Signed by: weeman
GPG Key ID: 34F0524D4DA694A1
3 changed files with 10 additions and 3 deletions

View File

@ -0,0 +1 @@
dev:$apr1$btDCHvFb$g/e8.gemqHTdLzKBtUDjW1

View File

@ -2,10 +2,13 @@
apt: apt:
name: nginx name: nginx
- name: be sure the nginx config file is present - name: be sure the nginx files are present
copy: copy:
src: ../files/nginx.conf src: "../files/{{ item }}"
dest: /etc/nginx/nginx.conf dest: "/etc/nginx/{{ item }}"
with_items:
- nginx.conf
- kipasswd
- name: be sure nginx site config files are present - name: be sure nginx site config files are present
template: template:

View File

@ -25,6 +25,9 @@ server {
} }
location / { location / {
auth_basic "KI";
auth_basic_user_file /etc/nginx/kipasswd;
proxy_pass http://localhost:{{ ki_frontend_port }}; proxy_pass http://localhost:{{ ki_frontend_port }};
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;