Skip to content
Website

Domain & HTTPS

This guide is for administrators exposing Patchwork over HTTPS in production.

  • A registered domain with two DNS A/AAAA records:
    • patchwork.example.com (the Next.js app)
    • files.patchwork.example.com (dedicated MinIO host)
  • Ports 80 and 443 open in your firewall (ufw allow 80,443/tcp)

Browsers upload and download attachments directly via S3 presigned URLs signed against MINIO_PUBLIC_URL. AWS/MinIO S3 signature verification (SignatureV4) hashes the exact request host and path. Using a path prefix rewrite (such as /s3/) breaks presigned URL signatures, so Patchwork requires a dedicated host (https://files.patchwork.example.com).

Set both variables in .env:

APP_URL=https://patchwork.example.com
MINIO_PUBLIC_URL=https://files.patchwork.example.com

Copy deploy/Caddyfile to /etc/caddy/Caddyfile and replace the example domains. The /api/events* route sets flush_interval -1 so SSE events stream immediately without buffering.

Terminal window
sudo cp deploy/Caddyfile /etc/caddy/Caddyfile
sudo systemctl reload caddy

By default, Patchwork builds and serves the documentation site directly at /documentation on the same origin and port (for example https://patchwork.example.com/documentation). deploy/Caddyfile and deploy/nginx.conf proxy /documentation through to the app while keeping static asset cache headers intact.

If you prefer hosting documentation separately on a dedicated subdomain, build the standalone bundle with npm run docs:build:standalone (DOCS_BASE=/) and serve docs-site/dist/ behind Nginx or Caddy:

docs.patchwork.example.com {
root * /opt/patchwork/docs-site/dist
file_server
}

https://patchwork.example.com loads over TLS, /api/events streams real-time board updates without stalling, and attachment uploads/downloads succeed against https://files.patchwork.example.com.

  • Uploads fail with SignatureDoesNotMatch: Verify MINIO_PUBLIC_URL in .env matches the exact https://files.<domain> URL in your browser and proxy config.
  • Board updates require manual refresh: Ensure proxy_buffering off (Nginx) or flush_interval -1 (Caddy) is active on /api/events.