From 5d4340ae28f295982f15bdbcc408965fe7c40683 Mon Sep 17 00:00:00 2001 From: ITQ Date: Wed, 3 Apr 2024 05:46:03 +0300 Subject: [PATCH] Added basic auth --- docker-compose.yml | 1 + nginx/.htpasswd | 1 + nginx/nginx.conf | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 nginx/.htpasswd diff --git a/docker-compose.yml b/docker-compose.yml index 5f1326d..1a5c078 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,6 +57,7 @@ services: - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf + - ./nginx/.htpasswd:/etc/nginx/.htpasswd - media_volume:/var/html/media/ - static_volume:/var/html/static/ depends_on: diff --git a/nginx/.htpasswd b/nginx/.htpasswd new file mode 100644 index 0000000..3663ae8 --- /dev/null +++ b/nginx/.htpasswd @@ -0,0 +1 @@ +admin:admin \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 14d9870..7d944c1 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -9,6 +9,14 @@ server { proxy_set_header Host $host; proxy_redirect off; } + location /dash/ { + auth_basic "Restricted Access"; + auth_basic_user_file /etc/nginx/.htpasswd; + + root /usr/share/nginx/html/; + index index.html; + try_files $uri $uri/ /index.html; + } location / { root /usr/share/nginx/html/; index index.html;