Skip to content

Reverse Proxy

Autentico listens on plain HTTP. Always deploy it behind a TLS-terminating reverse proxy in production.

Caddy handles TLS automatically via Let’s Encrypt:

auth.example.com {
reverse_proxy localhost:9999
}

Or with Docker Compose (Autentico on internal network):

auth.example.com {
reverse_proxy autentico:9999
}

If your relying party SPA needs to call the token endpoint from a browser, configure allowed origins via the Admin UI (CORS page) or the cors_allowed_origins runtime setting:

Terminal window
# Via API
curl -X PUT \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"cors_allowed_origins": "https://app.example.com,https://admin.example.com"}' \
https://auth.example.com/admin/api/settings

Use specific origins in production. Set * to allow all origins (development only). Leave empty to disable CORS and handle it at the reverse proxy level instead.

The X-Forwarded-For and X-Real-IP headers are logged with each request. Ensure your proxy sets them so the logs reflect real client IPs rather than the proxy’s IP.