Skip to main content

Reverse Proxy (Caddy)

The optional Caddy reverse proxy terminates TLS in front of IntelliAsk. Its PROXY_* keys in config/.env, the TLS modes, enabling/disabling it, and links to the official Caddy docs.

The reverse proxy is an optional Caddy container that sits in front of IntelliAsk and handles HTTPS, HTTP→HTTPS redirect, HTTP/2/3, WebSockets, and compression automatically — including obtaining and auto-renewing certificates. Caddy is a small single-binary proxy (idles ~30–40 MB).

See also the full guide

This page is the configuration reference. For the end-to-end walkthrough (DNS, TLS modes, firewall), see Reverse Proxy.

Overview

Compose fileconfig/proxy.compose.yml
Service nameproxy
Image variablePROXY_IMAGE (e.g. caddy:2.8-alpine)
ConfigPROXY_* keys in config/.env
Exposed443 (or 80 when TLS is off)
Certspersisted at ${STORAGE_ROOT}/caddy

The proxy is opt-in

The proxy reads its PROXY_* settings from the single config/.env like every other component. intelliask only includes it when PROXY_ENABLED=true. The public hostname lives once in config/.env as PUBLIC_HOST and the proxy reads it from there.

Environment variables

All proxy settings use the PROXY_ prefix in config/.env:

VariableDefaultWhat it does
PROXY_ENABLEDtrueMaster switch — when true, the proxy is included in the stack.
PROXY_IMAGEcaddy:2.8-alpineImage + tag to run.
PROXY_CPUS0.25CPU ceiling.
PROXY_MEMORY128mMemory ceiling.
PROXY_HTTPS_PORT443Published HTTPS port (only 443 is exposed).
PROXY_TLS_MODEinternalHow TLS certs are handled — see below.
PROXY_ACME_EMAIL–Contact email for ACME (auto mode).
PROXY_UPSTREAMintelliask:3080Backend the proxy forwards to.
PROXY_MAX_BODY_SIZE100mMax request/upload size.
PROXY_CERT_DIR./proxy/certsFolder holding cert.pem + key.pem when mode is file.

The public hostname comes from PUBLIC_HOST in config/.env (used as Caddy's server_name).

TLS modes (PROXY_TLS_MODE)

ModeWhat it doesWhen to use
autoPublic cert via Let's Encrypt (ACME) + auto-renew. Needs a public, internet-reachable PUBLIC_HOST and PROXY_ACME_EMAIL.Public deployments with real DNS.
internalCaddy's built-in CA (self-signed, auto-renewed). No internet needed; clients must trust Caddy's root.Internal/dev (*.intra). Default.
fileBring-your-own cert: put cert.pem + key.pem in PROXY_CERT_DIR. You renew the files.An internal-CA cert your clients already trust.
offPlain HTTP on :80, no TLS.Quick local/test only.

Tell the app TLS terminates here

When the proxy terminates TLS, set PUBLIC_SCHEME=https and TRUST_PROXY=1 (one proxy hop) in config/.env so the rate limiter sees the real client IP.

Enabling / disabling

The easiest path is at provision time:

intelliask provision --with-proxy

Or toggle it later with the module command (it flips PROXY_ENABLED / INTELLIASK_BIND and re-applies):

intelliask module enable proxy
intelliask module disable proxy

See Reverse Proxy for TLS modes and flags.

With the proxy on, provisioning binds the app port to 127.0.0.1 so only :443 is reachable externally — open inbound 443 at the host firewall and default-deny the rest.

Updating the proxy

# 1. Bump the tag in config/.env, e.g. PROXY_IMAGE=caddy:2.9-alpine
# 2. Pull + recreate only the proxy
intelliask update proxy

Issued/renewed certs persist under ${STORAGE_ROOT}/caddy, so a restart won't re-issue (avoids ACME rate limits).

Official documentation

Last updated on