From 4458c09c75490ccb8610707408345d0c951b9319 Mon Sep 17 00:00:00 2001 From: Kyle McLaren Date: Fri, 9 Jan 2026 18:59:27 +0200 Subject: [PATCH] Add basic auth to nginx Adds HTTP basic authentication to protect the docs site. Co-Authored-By: Claude Opus 4.5 --- .htpasswd | 1 + Dockerfile | 1 + nginx.conf | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 .htpasswd diff --git a/.htpasswd b/.htpasswd new file mode 100644 index 0000000..aebf246 --- /dev/null +++ b/.htpasswd @@ -0,0 +1 @@ +sprites:$apr1$DhpIgP1k$ZYo9mH0DVr.CLZCGJ0AqZ/ diff --git a/Dockerfile b/Dockerfile index 04849fd..cd9f70e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN pnpm run build FROM nginx:alpine COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY .htpasswd /etc/nginx/.htpasswd COPY --from=build /app/dist /usr/share/nginx/html EXPOSE 80 diff --git a/nginx.conf b/nginx.conf index e4f62ea..3583714 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,6 +3,9 @@ server { root /usr/share/nginx/html; error_page 404 /404.html; + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/.htpasswd; + location / { try_files $uri $uri/ $uri.html =404; }