Skip to main content

Reverse proxy & HTTPS

For anything beyond a local trial, put port 8400 behind a reverse proxy (Caddy, nginx, Traefik) or a tunnel such as Cloudflare Tunnel, which also gives you HTTPS. Set it up to:

  • Keep the Host header unchanged, and send X-Forwarded-Proto from the hop that handles HTTPS.
  • Add the visitor's address to X-Forwarded-For instead of passing on one the visitor sent. On nginx, that's proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;.
  • Pass WebSocket upgrades (the Upgrade and Connection headers), since the live dashboard runs on /ws/.

Tell OtoDock about the proxy​

Two settings go in .env: DASHBOARD_PUBLIC_URL, the address people use, and TRUSTED_PROXY, the address your proxy connects from.

If the proxy runs on another machine, trust that machine's LAN IP:

# .env
DASHBOARD_PUBLIC_URL=https://otodock.example.com
TRUSTED_PROXY=192.168.1.20 # the proxy machine's LAN IP
COLLABORA_SSL_TERMINATION=true

If the proxy or tunnel runs on this server, let only this server reach port 8400 and trust Docker's gateway:

# .env
DASHBOARD_PUBLIC_URL=https://otodock.example.com
PROXY_BIND_IP=127.0.0.1 # port 8400 answers only this server, so nobody skips the proxy
TRUSTED_PROXY=10.200.0.1 # Docker's gateway
COLLABORA_SSL_TERMINATION=true

Without COLLABORA_SSL_TERMINATION=true on an https address, the document editor stays blank.

Apply the changes with docker compose up -d, then docker compose restart otodock-proxy. If TRUSTED_PROXY is wrong, OtoDock shows the address your proxy really connects from under Setup → Security, ready to copy. Name only your proxy's address, or the smallest range that holds it.

Gateways that force a login​

If a gateway forces a login on every request (Authentik, Authelia, oauth2-proxy, Cloudflare Access), a few paths must skip it. The clients calling them can't complete a browser login. These paths are public files, or OtoDock checks them itself:

  • ^/ui-kit/: the styles and chart libraries that artifacts and apps load.
  • ^/s/: share links. The people who open them have no account.
  • ^/v1/apps/[0-9a-f-]{36}/(api|ws|platform|client)(/|$): apps with a server.
  • ^/v1/apps/[0-9a-f-]{36}/inbound/: an app's incoming webhooks.
  • ^/v1/webhooks/: incoming triggers and integration events.
  • /ws/: the live dashboard connection.
  • ^/v1/satellite: only if you use remote machines.
  • ^/v1/images/temp/: only if you use reverse image search.
  • ^/v1/twilio/: only if you connect the phone service to Twilio.

Everything else stays behind your gateway, the document editor (/collabora/) included. The API & Webhooks page shows where these exemptions go in each common gateway.

Next steps​