Skip to content

Reverse Proxy

This content is for v1.0. Switch to the latest version for up-to-date documentation.

When running Klokk behind a reverse proxy, set these two variables in addition to your proxy config:

  • Set SESSION_SECURE_COOKIE=true — required when served over HTTPS.
  • Set BASE_URL=https://yourdomain.com — no trailing slash.
server {
listen 443 ssl;
server_name yourdomain.com;
# TLS config omitted — use certbot or similar
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
yourdomain.com {
reverse_proxy localhost:8080
}

Caddy automatically provisions and renews TLS certificates via Let’s Encrypt — no additional TLS configuration needed.