# Example nginx virtual host for the Debian LXC. # Serves the frontend (static Vite build) and reverse-proxies /api to the # Node backend running on localhost:8787 via the story-api systemd service. # # Copy it to /etc/nginx/sites-available/historias, adjust the domain and # path, then: # ln -s /etc/nginx/sites-available/historias /etc/nginx/sites-enabled/historias # nginx -t && systemctl reload nginx # For TLS with Let's Encrypt: certbot --nginx -d your-domain.example server { listen 80; listen [::]:80; server_name your-domain.example; root /opt/historias/frontend/dist; index index.html; location /api/ { proxy_pass http://127.0.0.1:8787/api/; 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 / { try_files $uri /index.html; } }