From bbb0ec48f92ba2bfb5866e9017860c69e33759ea Mon Sep 17 00:00:00 2001 From: Florian Zumpe Date: Wed, 30 Sep 2026 01:28:26 +0200 Subject: [PATCH] add example nginx config --- nginx/wegwichtel.conf | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 nginx/wegwichtel.conf diff --git a/nginx/wegwichtel.conf b/nginx/wegwichtel.conf new file mode 100644 index 0000000..be33747 --- /dev/null +++ b/nginx/wegwichtel.conf @@ -0,0 +1,72 @@ +# nginx/wegwichtel.conf +# +# Reverse-Proxy-Konfiguration für Wegwichtel. +# +# Voraussetzung: +# - Wegwichtel lauscht lokal auf 127.0.0.1:47145 +# +# Aktiv verwendet die Konfiguration ausschließlich HTTP auf Port 80. +# Die auskommentierten SSL-Direktiven dienen nur als Vorlage. Die dort +# referenzierten Dateien snakeoil.pem und snakeoil.key existieren bewusst nicht. +# TLS kann später beispielsweise durch Certbot ergänzt werden. +# +# Installation z. B.: +# sudo cp nginx/wegwichtel.conf /etc/nginx/sites-available/wegwichtel.conf +# sudo ln -s /etc/nginx/sites-available/wegwichtel.conf /etc/nginx/sites-enabled/wegwichtel.conf +# sudo nginx -t +# sudo systemctl reload nginx + +server { + listen 80; + listen [::]:80; + # listen 443 ssl; + # listen [::]:443 ssl; + + server_name wegwichtel.de www.wegwichtel.de; + + # SSL-Vorlage. Die Zertifikatsdateien sind absichtlich nicht vorhanden. + # Vor einer manuellen Aktivierung müssen sie durch reale Zertifikatspfade + # ersetzt oder die Konfiguration durch ein Werkzeug wie Certbot angepasst werden. + # ssl_certificate /etc/nginx/ssl/snakeoil.pem; + # ssl_certificate_key /etc/nginx/ssl/snakeoil.key; + # ssl_protocols TLSv1.2 TLSv1.3; + # ssl_session_cache shared:SSL:10m; + # ssl_session_timeout 1d; + # ssl_session_tickets off; + + # Lokale Strecken bleiben im Browser. Medien-Uploads sind nur für + # noch nicht freigegebene Server-Strecken vorgesehen. + client_max_body_size 64m; + + # Sicherheitsheader, die mit dem bestehenden Frontend kompatibel bleiben. + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + + location / { + proxy_pass http://127.0.0.1:47145; + + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + + # Verhindert unnötiges Puffern größerer Medien-Uploads. + proxy_request_buffering off; + + proxy_connect_timeout 10s; + proxy_send_timeout 120s; + proxy_read_timeout 120s; + } + + location = /favicon.ico { + proxy_pass http://127.0.0.1:47145/favicon.ico; + access_log off; + log_not_found off; + } + + access_log /var/log/nginx/wegwichtel.access.log; + error_log /var/log/nginx/wegwichtel.error.log warn; +}