Files
parenthese/deploy/nginx.conf
T
IliesAllaliandClaude Opus 5 e8e2485dcd Parenthèse
Galaxie familiale : personnes, unions et filiations, photos, vidéos et voix sur chaque personne,
partage par lien avec consultation sans compte et contributions validées par le propriétaire.
Auto-hébergeable avec Docker. Licence PolyForm Noncommercial 1.0.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 15:49:05 +02:00

155 lines
5.6 KiB
Nginx Configuration File

# ─── app.parenthese.io ────────────────────────────────────────────────────────
server {
listen 80;
server_name app.parenthese.io;
return 301 https://app.parenthese.io$request_uri;
}
server {
listen 443 ssl http2;
server_name app.parenthese.io;
ssl_certificate /etc/letsencrypt/live/app.parenthese.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/app.parenthese.io/privkey.pem;
# Security headers
# frame-ancestors allows the landing page (parenthese.io) to embed the app in an iframe
add_header Content-Security-Policy "frame-ancestors 'self' https://parenthese.io https://www.parenthese.io" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
root /var/www/parenthese/frontend/dist;
index index.html;
location /api/ {
rewrite ^/api(/.*)$ $1 break;
proxy_pass http://127.0.0.1:4000;
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;
client_max_body_size 25m;
proxy_connect_timeout 10s;
proxy_send_timeout 30s;
proxy_read_timeout 30s;
}
location /auth/ {
proxy_pass http://127.0.0.1:4000;
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;
}
location /trees {
proxy_pass http://127.0.0.1:4000;
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;
client_max_body_size 25m;
}
location /health {
proxy_pass http://127.0.0.1:4000;
proxy_http_version 1.1;
}
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
add_header Pragma "no-cache" always;
add_header Content-Security-Policy "frame-ancestors 'self' https://parenthese.io https://www.parenthese.io" always;
# Keep embedding control in CSP; override any inherited SAMEORIGIN frame header.
add_header X-Frame-Options "ALLOWALL" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, immutable";
add_header Content-Security-Policy "frame-ancestors 'self' https://parenthese.io https://www.parenthese.io" always;
add_header X-Frame-Options "ALLOWALL" always;
add_header X-Content-Type-Options "nosniff" always;
}
}
# ─── parenthese.io (landing) ─────────────────────────────────────────────────
server {
listen 80;
server_name parenthese.io www.parenthese.io;
return 301 https://parenthese.io$request_uri;
}
server {
listen 443 ssl http2;
server_name www.parenthese.io;
ssl_certificate /etc/letsencrypt/live/parenthese.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/parenthese.io/privkey.pem;
return 301 https://parenthese.io$request_uri;
}
server {
listen 443 ssl http2;
server_name parenthese.io;
ssl_certificate /etc/letsencrypt/live/parenthese.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/parenthese.io/privkey.pem;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Frame-Options "DENY" always;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
root /var/www/parenthese/landing/dist;
index index.html;
# Waitlist API — proxy vers le backend Fastify existant
location = /api/waitlist {
proxy_pass http://127.0.0.1:4000/waitlist;
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_connect_timeout 10s;
proxy_send_timeout 10s;
proxy_read_timeout 10s;
}
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
add_header Pragma "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
}
# Fingerprinted static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}