Skip to main content
A reverse proxy sits in front of Comis and handles TLS (HTTPS), custom domains, and can add an extra layer of security. This is the recommended setup for production servers exposed to the internet.

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.com instead 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 your config.yaml:
Here is what each setting does:
  • 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-For header from the proxy, so rate limiting and logging show the real client IP instead of the proxy’s IP
Do not add public IPs to trustedProxies. Only add the IP addresses of your reverse proxy servers. Adding untrusted IPs would allow anyone to spoof their client IP address.

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.
Certbot automatically renews certificates before they expire. You do not need to manage renewals manually.

Caddy

Caddy is a simpler alternative that handles TLS automatically with zero extra configuration.
1

Install Caddy

Install Caddy on your server:
See the Caddy install docs for other platforms.
2

Create the Caddyfile

Edit the Caddyfile (usually at /etc/caddy/Caddyfile):
Replace 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

Your site is now accessible at https://comis.yourdomain.com.
Caddy is the simpler option — it handles TLS automatically with zero configuration. Choose Nginx if you need more advanced features like load balancing, caching, or custom header manipulation.

CORS configuration

If you access the web dashboard from a different domain than the API (uncommon), you may need to configure CORS. In your config.yaml:
This tells Comis to accept requests from the specified origin. In most setups this is not needed because the web dashboard and API are served from the same domain through the reverse proxy.

Verifying the setup

After setting up the reverse proxy and TLS, verify everything is working: 1. Check the health endpoint:
Expected output:
2. Check the full response:
Expected output:
3. Open the web dashboard: Visit https://comis.yourdomain.com in your browser. You should see the Comis web dashboard.

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.