From 158ef648eec3938f61ad9c36d6ea759ccff5d7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=B6hler?= Date: Mon, 2 Mar 2026 20:18:54 +0100 Subject: [PATCH] Document Nginx Basic Auth setup for web deployment --- WEB_README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/WEB_README.md b/WEB_README.md index a721406..5df5f2a 100644 --- a/WEB_README.md +++ b/WEB_README.md @@ -90,6 +90,8 @@ server { server_name ics.example.de; client_max_body_size 10M; + auth_basic "Geschuetzter Bereich"; + auth_basic_user_file /etc/nginx/.htpasswd-pdf-to-ics; location / { proxy_pass http://127.0.0.1:8000; @@ -109,6 +111,30 @@ sudo nginx -t sudo systemctl reload nginx ``` +### 2b) Basic Auth einrichten (empfohlen) + +```bash +sudo apt-get update +sudo apt-get install -y apache2-utils +sudo htpasswd -c /etc/nginx/.htpasswd-pdf-to-ics kalender +sudo nginx -t +sudo systemctl reload nginx +``` + +Weitere Nutzer hinzufügen (ohne `-c`): + +```bash +sudo htpasswd /etc/nginx/.htpasswd-pdf-to-ics weiterer_user +``` + +Schnelltest: + +```bash +curl -I https://ics.example.de +``` + +Erwartung: zuerst `401 Unauthorized`, mit Login im Browser dann Zugriff. + ### 3) HTTPS mit Let's Encrypt ```bash @@ -125,6 +151,6 @@ sudo certbot renew --dry-run ### 4) Mindest-Sicherheit -- Zugriffe absichern (z. B. Basic Auth oder Login) +- Zugriffe absichern (mindestens Basic Auth) - Upload-Limit klein halten (`client_max_body_size`) - Server und Pakete regelmäßig aktualisieren