Why use a reverse proxy
- TLS encryption — all traffic between clients and your server is encrypted with HTTPS
- Custom domain — access Comis at
comis.yourdomain.cominstead of an IP address and port number - Hide the port — users visit a standard HTTPS URL without needing to know the port (4766)
- Security headers — the proxy can add headers that protect against common web attacks
Comis configuration
Before setting up the proxy, configure the Comis gateway to accept proxied connections. In yourconfig.yaml:
- host: “127.0.0.1” — the gateway only listens on localhost (the reverse proxy handles external connections)
- trustedProxies — tells Comis to trust the
X-Forwarded-Forheader from the proxy, so rate limiting and logging show the real client IP instead of the proxy’s IP
Nginx
1
Install Nginx
Install Nginx on your server:
2
Create the configuration
Create a new Nginx config file for Comis:Paste the following configuration:Replace
comis.yourdomain.com with your actual domain name.Here is what the important lines do:3
Enable the site
Create a symlink to enable the config, test it, and reload Nginx:Expected output from
nginx -t:4
Add TLS with Certbot
Install Certbot and obtain a free TLS certificate from Let’s Encrypt:Certbot automatically modifies your Nginx config to add HTTPS and sets up
automatic certificate renewal. After running this command, your site is
accessible at
https://comis.yourdomain.com.Caddy
Caddy is a simpler alternative that handles TLS automatically with zero extra configuration.1
Install Caddy
2
Create the Caddyfile
Edit the Caddyfile (usually at Replace
/etc/caddy/Caddyfile):comis.yourdomain.com with your actual domain name.That is the entire configuration. Caddy automatically:- Obtains a TLS certificate from Let’s Encrypt
- Redirects HTTP to HTTPS
- Renews certificates before they expire
- Handles WebSocket connections
3
Start Caddy
https://comis.yourdomain.com.CORS configuration
If you access the web dashboard from a different domain than the API (uncommon), you may need to configure CORS. In yourconfig.yaml:
Verifying the setup
After setting up the reverse proxy and TLS, verify everything is working: 1. Check the health endpoint:https://comis.yourdomain.com in your browser. You should see the Comis
web dashboard.
Related pages
Web UI
Set up and access the web dashboard.
Docker
Run Comis in a Docker container.
systemd
Run Comis as a systemd service.
pm2
Run Comis with the pm2 process manager.
Daemon
How the daemon starts, runs, and shuts down.
