server {
    listen 443 ssl;
    server_name foundry.lefloch.eu;

    ssl_certificate      /usr/local/etc/letsencrypt/live/lefloch.eu/fullchain.pem;
    ssl_certificate_key  /usr/local/etc/letsencrypt/live/lefloch.eu/privkey.pem;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

    location / {
        proxy_pass http://192.168.0.102:30000;

        # 🔑 WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Headers classiques
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto https;

        proxy_read_timeout 86400;
        proxy_send_timeout 86400;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/local/www/nginx-dist;
    }
}
