- nginx-Proxy POST /api/mail/send -> mp-mail-api:8080 (nur POST, 64k Limit) - Token serverseitig via envsubst-Template + portal.env (gitignored, nur Server) - src/lib/mail.ts: fire-and-forget Versand, Empfaenger-Aufloesung (Verwaltung/Mieter) - Benachrichtigung: neue Schadensmeldung -> Verwaltung, Nachrichten/Antworten -> Gegenstelle - E2E live verifiziert (versandt: true an axel@hocks.eu), GET 403 - Doku (kimi.md, README) nachgefuehrt
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
server {
|
||
listen 80;
|
||
server_name mieterportal.hocks.eu localhost _;
|
||
|
||
root /usr/share/nginx/html;
|
||
index index.html;
|
||
|
||
gzip on;
|
||
gzip_types text/css application/javascript image/svg+xml application/json;
|
||
gzip_min_length 1024;
|
||
|
||
# HTML nie cachen (Assets sind hash-benannt → ein Reload genügt)
|
||
location = /index.html {
|
||
add_header Cache-Control "no-cache" always;
|
||
}
|
||
|
||
# Cache für gehashte Build-Assets
|
||
location /assets/ {
|
||
expires 30d;
|
||
add_header Cache-Control "public, immutable";
|
||
}
|
||
|
||
# Mail-API des Portals (Container mp-mail-api im selben Docker-Netz npm_default).
|
||
# Das Token kommt aus portal.env (envsubst beim Container-Start) und liegt
|
||
# NIE im Repo und NIE im Browser – der Endpunkt ist nur vom Server erreichbar.
|
||
location = /api/mail/send {
|
||
limit_except POST { deny all; }
|
||
proxy_pass http://mp-mail-api:8080/send;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Api-Token "${MAIL_API_TOKEN}";
|
||
proxy_set_header X-Request-Source mieterportal-nginx;
|
||
client_max_body_size 64k;
|
||
proxy_read_timeout 15s;
|
||
}
|
||
|
||
# SPA-Fallback für React Router
|
||
location / {
|
||
try_files $uri $uri/ /index.html;
|
||
}
|
||
|
||
add_header X-Content-Type-Options "nosniff" always;
|
||
add_header X-Frame-Options "DENY" always;
|
||
}
|