server {
    listen 5354 ssl;  # NGINX listens on port 5354 for SSL connections.
    server_name oi.ixty.ai;

    # SSL certificate paths (wildcard cert for *.ixty.ai)
    ssl_certificate /etc/letsencrypt/live/ixty.ai/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ixty.ai/privkey.pem;

    # SSL configuration (add these lines)
    ssl_protocols TLSv1.2 TLSv1.3;  # Only allow TLS v1.2 and v1.3
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';

    # Proxy traffic to Open WebUI running in Podman at 192.168.1.201:8080
    location / {
        proxy_pass http://192.168.1.201:8080;
        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;

        # Support for Websockets
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
