The steps below are written for Ubuntu / Debian. Package and path names differ slightly on RHEL-based distros (
dnf instead of apt, /etc/nginx/conf.d/ instead of /etc/nginx/sites-available/).Installation
1
Install Nginx and Certbot
2
Create the webroot directory
3
Create a temporary HTTP config
Create Enable it and reload:
/etc/nginx/sites-available/chatbotx with a minimal config that lets Certbot complete the ACME challenge:/etc/nginx/sites-available/chatbotx
4
Obtain TLS certificates
/etc/letsencrypt/live/<domain>/.5
Replace with the full HTTPS config
Overwrite
/etc/nginx/sites-available/chatbotx with the configuration below.6
Test and reload Nginx
7
Enable automatic certificate renewal
Certbot installs a systemd timer by default. Verify it is active:Add a reload hook so Nginx picks up renewed certificates automatically:
ChatbotX configuration
Update your.env to use the public HTTPS URLs and restart the services:
.env
WebSocket support
PartySocket requires theUpgrade and Connection headers to be forwarded. The secure config above includes these on the ws.yourdomain.com server block. The extended proxy_read_timeout and proxy_send_timeout values (3600s) prevent Nginx from closing long-lived WebSocket connections.
Storage (RustFS / S3)
The storage service runs on port9000. Proxying it through Nginx gives you HTTPS asset URLs. Set client_max_body_size to a value larger than your largest expected upload — the example uses 1G.
The storage console (port
9001) does not need to be publicly exposed. Access it directly on the server via an SSH tunnel or restrict it to a local interface.