production: docker fixes, nginx SSL config, generateStaticParams fallback
Deploy to VPS / deploy (push) Has been cancelled
Deploy to VPS / deploy (push) Has been cancelled
This commit is contained in:
+32
-15
@@ -1,10 +1,5 @@
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
# FLUX SRL — Nginx Site Configuration
|
||||
# Phase 1: HTTP only (SSL added after certbot runs)
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
|
||||
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
|
||||
limit_req_zone $binary_remote_addr zone=login:10m rate=3r/m;
|
||||
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/s;
|
||||
|
||||
upstream nextjs {
|
||||
server app:3000;
|
||||
@@ -15,12 +10,31 @@ server {
|
||||
listen 80;
|
||||
server_name rf-flux.com www.rf-flux.com;
|
||||
|
||||
# Let's Encrypt challenge (keep this even after SSL)
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
# Static assets: Next.js hashed (immutable cache)
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name rf-flux.com www.rf-flux.com;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/rf-flux.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/rf-flux.com/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||
|
||||
location /_next/static/ {
|
||||
proxy_pass http://nextjs;
|
||||
expires 365d;
|
||||
@@ -28,7 +42,6 @@ server {
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Static assets: footage, GLB models
|
||||
location /footage/ {
|
||||
proxy_pass http://nextjs;
|
||||
expires 30d;
|
||||
@@ -36,9 +49,16 @@ server {
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# CMS Admin (strict rate limiting)
|
||||
location /hq-command/ {
|
||||
limit_req zone=login burst=5 nodelay;
|
||||
location /hq-command/login {
|
||||
limit_req zone=login burst=10 nodelay;
|
||||
proxy_pass http://nextjs;
|
||||
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 /hq-command/ {
|
||||
proxy_pass http://nextjs;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -46,7 +66,6 @@ server {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# FluxAI Chat API (streaming + rate limited)
|
||||
location /api/chat {
|
||||
limit_req zone=api burst=20 nodelay;
|
||||
proxy_pass http://nextjs;
|
||||
@@ -61,13 +80,11 @@ server {
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
|
||||
# Health check
|
||||
location /api/health {
|
||||
proxy_pass http://nextjs;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Default
|
||||
location / {
|
||||
proxy_pass http://nextjs;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
Reference in New Issue
Block a user