Recommended Approach: Reverse Proxy
The recommended way to add SSL to Zipline is using a reverse proxy like Nginx, Caddy, or Traefik. These handle SSL termination and certificate management.Zipline itself doesn’t have built-in SSL/TLS support. Use a reverse proxy for HTTPS.
Quick Start: Caddy (Easiest)
Caddy is the simplest option as it automatically obtains and renews SSL certificates.Install Caddy
Follow the official Caddy installation guide for your OS.
Let’s Encrypt with Certbot (Nginx/Apache)
For Nginx or Apache, use Certbot to obtain free SSL certificates from Let’s Encrypt.Prerequisites
- Domain name pointing to your server
- Nginx or Apache installed and configured
- Ports 80 and 443 open
Nginx + Certbot
Obtain certificate
- Enter your email address
- Agree to terms of service
- Choose whether to redirect HTTP to HTTPS (recommended: yes)
Apache + Certbot
Docker Compose with Caddy
Run Caddy alongside Zipline in Docker Compose for a complete solution.When using Docker networking, reference the Zipline service by its service name (
zipline) instead of localhost.Cloudflare SSL
Cloudflare provides free SSL certificates and DDoS protection.Add domain to Cloudflare
- Sign up at cloudflare.com
- Add your domain
- Update nameservers at your domain registrar
Configure SSL mode
In Cloudflare dashboard:
- Go to SSL/TLS settings
- Set SSL mode to Full (or Full (strict) if you have a valid cert on your origin)
Enable additional features (optional)
- Always Use HTTPS: Redirect HTTP to HTTPS
- Automatic HTTPS Rewrites: Fix mixed content
- Minimum TLS Version: Set to TLS 1.2 or higher
Cloudflare Origin Certificate (Recommended)
For better security with Cloudflare:Generate origin certificate
In Cloudflare dashboard:
- Go to SSL/TLS → Origin Server
- Click “Create Certificate”
- Choose key type and validity (up to 15 years)
- Click “Create”
Save certificate files
Save both:
- Origin Certificate (save as
origin-cert.pem) - Private Key (save as
origin-key.pem)
Self-Signed Certificates (Development Only)
Configuration After SSL Setup
Once SSL is configured, update Zipline settings:Verifying SSL Setup
Test with SSL Labs
Visit SSL Labs SSL Test and enter your domain.Aim for an A or A+ rating.
Troubleshooting
Certificate validation failed
Certificate validation failed
- Ensure your domain DNS points to your server
- Check that ports 80 and 443 are open
- Verify firewall rules allow ACME challenge requests
- Check Certbot logs:
sudo tail -f /var/log/letsencrypt/letsencrypt.log
Mixed content warnings
Mixed content warnings
This happens when HTTPS pages load HTTP resources:
- Ensure
CORE_RETURN_HTTPS_URLS=trueis set - Check that custom themes don’t reference HTTP resources
- If using Cloudflare, enable “Automatic HTTPS Rewrites”
Certificate renewal fails
Certificate renewal fails
- Check that your web server serves
.well-known/acme-challenge/ - Ensure ports 80 and 443 remain accessible
- Verify Certbot timer is active:
systemctl status certbot.timer - Check renewal logs:
sudo journalctl -u certbot.service
Uploaded files show HTTP URLs instead of HTTPS
Uploaded files show HTTP URLs instead of HTTPS
- Verify
CORE_RETURN_HTTPS_URLS=trueis set - Restart Zipline after changing configuration
- Check that
CORE_TRUST_PROXY=trueis set if using a reverse proxy - Ensure reverse proxy sends
X-Forwarded-Proto: httpsheader
ERR_SSL_PROTOCOL_ERROR
ERR_SSL_PROTOCOL_ERROR
- Verify SSL certificate paths in reverse proxy config
- Check that certificate files are readable
- Ensure private key matches certificate
- Test SSL config:
sudo nginx -torsudo apache2ctl configtest
Security Recommendations
- Use TLS 1.2 or higher: Disable older protocols (TLS 1.0, 1.1)
- Strong cipher suites: Use modern, secure ciphers
- Enable HSTS: Force browsers to use HTTPS
- Regular updates: Keep your reverse proxy and OS updated
- Monitor expiration: Set up alerts for certificate expiration
- Use CAA records: Restrict which CAs can issue certificates for your domain