Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Building and custom Nginx

Building from Source

docker build -t caddy-ui-backend ./src/backend
docker build -t caddy-ui-frontend ./src/frontend

The backend image copies the Caddy binary from caddy:latest at build time for caddy fmt formatting and version detection. To pin to a specific Caddy version, change the COPY --from=caddy:latest line in src/backend/Dockerfile before building:

COPY --from=caddy:v2.11.2 /usr/bin/caddy /usr/bin/caddy

If you run Caddy outside of Docker (e.g. systemd), the backend will still work correctly — caddy fmt and version detection will degrade gracefully if the binary version doesn’t match or is unavailable.

Custom Nginx Config

The frontend proxies API requests to caddy-ui-backend:3001 by default. To preserve client addresses behind Caddy or another reverse proxy, set CADDY_UI_TRUSTED_UPSTREAMS on the frontend container to that proxy’s specific IP/CIDR (comma-separated for multiple proxies). Unset trusts no upstream forwarding headers. See client addresses and rate limits.

These settings also apply to prebuilt images. If your backend has a different hostname or port, mount a custom Nginx config:

volumes:
  - ./nginx.conf:/etc/nginx/conf.d/default.conf