Skip to content

Reverse proxy

The control plane serves plain HTTP. Something has to serve HTTPS in front of it:

  • SiloOS has its own Caddy and needs nothing in front. Read on only if a proxy of yours must sit above the machine.
  • A container needs a proxy of yours, or a Caddy that Silo configures itself (Domains and HTTPS).

Whatever proxy you use, the console works only when it:

  • Keeps the Host header. The content domain is served by subdomain (tunnel-…, app-…, share-…), and the desktop’s and console’s sockets check the origin against it.
  • Passes WebSockets. The desktop (/vnc), the Bot’s terminal (/console) and calls (/voice/call) are WebSockets.
  • Does not buffer, and does not time out a long response. A conversation’s live updates are one long streamed response. A proxy that buffers it shows a reply only when it is finished; one that cuts it after a minute makes the console reconnect over and over.
  • Accepts 50 MB uploads. That is the largest file a person can attach to a message.
  • Adds X-Forwarded-For, and is named in Admin → Settings → Sign-in → Trusted proxies. Until it is, every visitor looks like the proxy: they share one sign-in limit, so a few wrong passwords from anyone make everyone wait.

And Silo must know the address people use: Admin → Settings → Server → Public URL set to https:// your name.

The proxy sits on the same host and forwards to 127.0.0.1:8080. Serve both names: the console’s and the content domain’s wildcard.

Then name the proxy in Trusted proxies, as the address the control plane sees it at. Sign in through the proxy and open Account → Sessions: the address shown there is the one to enter. It is usually 127.0.0.1, but a rootless Podman forwarding the port can show another, such as the container network’s gateway.

Caddy keeps the host, passes WebSockets and streams by itself. A wildcard certificate needs a DNS challenge, so the content domain gets a certificate per name instead, made on demand, and Caddy asks Silo before each one so nobody can make it request certificates for names at will:

Caddyfile
{
on_demand_tls {
ask http://127.0.0.1:8080/caddy/ask
}
}
silo.example.com {
reverse_proxy 127.0.0.1:8080 {
flush_interval -1
}
}
*.silo-content.example.com {
tls {
on_demand
}
reverse_proxy 127.0.0.1:8080 {
flush_interval -1
}
}

/caddy/ask answers only a caller on loopback or one of the trusted proxies, and only yes for names that exist.

Keep 8080 and 8081 from the outside (Network): the proxy is the way in.

  • Open the console, send a Bot a message, and watch the reply appear as it is written. If it appears only when finished, the proxy is buffering.
  • Open the Bot’s Desktop. If it never connects, WebSockets are not passed, or the Host header is not kept.
  • Account → Sessions lists each sign-in with its address. It should be yours, not the proxy’s.
  • SiloOS behind a proxy sees every visitor as the proxy. SiloOS’s Caddy does not take an X-Forwarded-For it did not set, so the control plane sees the proxy’s address, and everyone shares one sign-in limit.
  • A proxy that serves Silo under a path (example.com/silo/). Silo needs a name of its own.