Documentation

Gateway & domains

How the gateway generates Caddy config, handles DNS, and issues SSL certificates.

Updated Aug 5, 20257 min read

Gateway & domains

The Gateway and Domain & SSL modules are the heart of launching customer sites. Gateway writes Caddy configuration from templates; Domain & SSL handles DNS verification and certificates. Together they make each subscriber’s product available over HTTPS.

Component flow

Domain record → DNS verify → Build Caddy config → Caddy reload → HTTPS health check
   (A record evidential)   (Gateway)   (Gateway)     (Caddy/Let's Encrypt)

Gateway (Caddy integration)

When Gateway → EnableGateway and EnableCaddyIntegration are on:

  1. Reads CaddyExecutablePath, CaddyConfigFolder, CaddyfileLocation.
  2. Uses WebsiteTemplateLocation to generate a reverse snippet per site.
  3. Writes the config and reloads Caddy.
Gateway Setting Purpose
EnableGateway Master switch for gateway execution
EnableCaddyIntegration Generate Caddy configs on change
CaddyExecutablePath Location of the caddy binary
CaddyConfigFolder Directory for per-site configs
CaddyfileLocation Main aggregator Caddyfile
WebsiteTemplateLocation Template used to emit a site block
PlatformServerIP Public IP used for DNS A records + verification

Website template

Each product site is emitted from WebsiteTemplateLocation, byte-inserted into the context. Template identifiers reference the installed product so the reverse snippet is correct.

SSL certificates

Certificates are issued automatically via Caddy’s Let’s Encrypt integration with zero manual steps:

  1. Gateway emits the site’s router entry to its Caddyfile.
  2. Caddy reloads and automatically provisions SSL for the domain via Let’s Encrypt.
  3. Certificates renew automatically before expiry.

Activation sub-flow

The gateway activation job (see onboarding):

  1. Reads PlatformServerIP to confirm DNS resolution.
  2. ActivationHealthTimeoutSeconds bounds the HTTPS health check.
  3. Retries up to MaximumActivationRetries at ActivationRetryIntervalMinutes.
  4. Flips the site to Active once verification passes.
Activation Setting Purpose
EnableAutomaticActivation Auto-activate Ready sites
ActivationRetryIntervalMinutes Delay between retries
MaximumActivationRetries Cap on attempts
ActivationHealthTimeoutSeconds HTTPS verification timeout

DNS verification

  • Customers point an A record at PlatformServerIP.
  • Verification only unlocks when the domain resolves to that IP.
  • Verify timeouts scale with DNS propagation (normally minutes).