Domain & HTTPS
This guide is for administrators exposing Patchwork over HTTPS in production.
Prerequisites
Section titled “Prerequisites”- A registered domain with two DNS
A/AAAArecords:patchwork.example.com(the Next.js app)files.patchwork.example.com(dedicated MinIO host)
- Ports
80and443open in your firewall (ufw allow 80,443/tcp)
Why MinIO Uses a Dedicated Subdomain
Section titled “Why MinIO Uses a Dedicated Subdomain”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.comMINIO_PUBLIC_URL=https://files.patchwork.example.comReverse Proxy Configuration (SSE-Safe)
Section titled “Reverse Proxy Configuration (SSE-Safe)”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.
sudo cp deploy/Caddyfile /etc/caddy/Caddyfilesudo systemctl reload caddyCopy deploy/nginx.conf to /etc/nginx/sites-available/patchwork.conf and enable it. /api/events disables proxy_buffering and proxy_cache and sets a 24-hour proxy_read_timeout.
sudo cp deploy/nginx.conf /etc/nginx/sites-available/patchwork.confsudo ln -sf /etc/nginx/sites-available/patchwork.conf /etc/nginx/sites-enabled/patchwork.confsudo nginx -t && sudo systemctl reload nginxEmbedded vs. Standalone Documentation
Section titled “Embedded vs. Standalone Documentation”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}server { listen 443 ssl http2; server_name docs.patchwork.example.com; root /opt/patchwork/docs-site/dist; index index.html; location / { try_files $uri $uri/ =404; }}Expected Result
Section titled “Expected Result”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.
Troubleshooting
Section titled “Troubleshooting”- Uploads fail with
SignatureDoesNotMatch: VerifyMINIO_PUBLIC_URLin.envmatches the exacthttps://files.<domain>URL in your browser and proxy config. - Board updates require manual refresh: Ensure
proxy_buffering off(Nginx) orflush_interval -1(Caddy) is active on/api/events.