36 lines
1.3 KiB
Text
36 lines
1.3 KiB
Text
# nginx-Reverse-Proxy für den Projekt-Hub.
|
|
#
|
|
# Installation:
|
|
# sudo cp deploy/nginx/projekt-hub.conf /etc/nginx/sites-available/projekt-hub
|
|
# sudo ln -s /etc/nginx/sites-available/projekt-hub /etc/nginx/sites-enabled/
|
|
# sudo nginx -t && sudo systemctl reload nginx
|
|
#
|
|
# HTTPS wird hier NICHT manuell konfiguriert — certbot --nginx ergänzt die
|
|
# TLS-Direktiven automatisch, sobald eine Domain feststeht (siehe DEPLOYMENT.md §10).
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
# Zunächst Server-IP; später auf die echte Domain ändern und certbot laufen lassen.
|
|
server_name DEINE_SERVER_IP;
|
|
|
|
# Statische Dateien direkt von nginx ausliefern (schneller, entlastet gunicorn).
|
|
location /static/ {
|
|
alias /home/projekthub/projekt-hub/app/static/;
|
|
expires 30d;
|
|
access_log off;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://unix:/home/projekthub/projekt-hub/projekt-hub.sock;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
# Wichtig: App nimmt HTTPS an (PREFERRED_URL_SCHEME=https, Secure-Cookies).
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# PDF-Export und sonstige Antworten dürfen ruhig etwas größer sein.
|
|
client_max_body_size 4m;
|
|
}
|