Skip to content
Start free

Domains and HTTPS

Open in ClaudeOpen in ChatGPT

DocSpring answers on the host name in DOCSPRING_DOMAIN_NAME, such as docspring.example.com, and uses it in every link it makes: in the app, in emails, in API responses and in embedded forms. Set it to the name people use to reach your install, and point a DNS record for that name at your load balancer or reverse proxy.

DocSpring doesn’t handle TLS itself: your load balancer or reverse proxy does, and forwards plain HTTP to the web service on port 4001. It must set the X-Forwarded-Proto header, so DocSpring knows the request came in over HTTPS.

Set DOCSPRING_FORCE_SSL=true once HTTPS works. DocSpring then makes https links, and redirects the app and admin host names to HTTPS with an HSTS header that covers subdomains.

Each of our deployments handles the certificate for you, if you like:

  • Docker Compose: Caddy gets a free certificate from Let’s Encrypt.
  • Kubernetes: your Ingress controller or Gateway, with cert-manager or your cloud’s certificates.
  • AWS ECS: the Application Load Balancer, with an ACM certificate.
  • AWS via Convox: Let’s Encrypt, through the rack.
  • Aptible: Aptible’s managed TLS.

The app, the API and the admin dashboard all answer on DOCSPRING_DOMAIN_NAME by default. To give any of them its own host name, set:

SettingFor
DOCSPRING_APP_DOMAIN_NAMEThe web app (sign-in, templates, submissions) and the links in emails
DOCSPRING_API_DOMAIN_NAMEAPI requests and the API URLs in the app. The API also answers on the app’s host name.
DOCSPRING_ADMIN_DOMAIN_NAMEThe admin dashboard and the Admin API

A separate admin host name lets you keep the admin dashboard off the internet, for example by only routing that name from your internal network.

DocSpring only answers requests for its own host names, which protects against DNS rebinding attacks. If something must reach it on another name, such as an internal service name, either add that name with one of these settings or, as a last resort, set DOCSPRING_ALLOW_ALL_HOSTS=true.

If people reach DocSpring on a port other than 80 or 443, add it to the domain (docspring.example.com:8443) or set DOCSPRING_PUBLIC_PORT, so the links DocSpring makes include it.

Every setting is described on the Environment variables page.