server {
    listen 3845 ssl;  # Listening on port 3845 for SSL connections
    server_name appflowy.ixty.ai;

    # SSL certificates from Let's Encrypt (Wildcard for *.ixty.ai)
    ssl_certificate /etc/letsencrypt/live/ixty.ai/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ixty.ai/privkey.pem;

    # SSL settings (you can improve this with additional security headers if needed)
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;

    # Proxy to the AppFlowy-Cloud container running on Podman (use the container's internal port)
    location / {
        proxy_pass http://192.168.1.201:3844;  # Update port to match your AppFlowy container's internal port
        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;
    }
}
