Add nginx basic auth via docker-compose environment variables

Credentials set via AUTH_USER / AUTH_PASS in docker-compose.yml.
Entrypoint generates htpasswd at container start using openssl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
yvierkoetter
2026-06-19 17:10:39 +02:00
parent 8cf7b70fad
commit c10bfaa87c
4 changed files with 23 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
auth_basic "Hochzeit";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
try_files $uri $uri/ =404;
}
}