Caddy (Recommended)
Caddy provides automatic HTTPS with zero configuration. It obtains and renews Let’s Encrypt certificates automatically.Docker Compose with Caddy
Sparklytics provides a ready-to-use Caddy setup:Caddyfile
Create aCaddyfile in the same directory:
Deployment Steps
Ensure DNS is configured
Your domain must point to your server’s IP address before starting. Caddy needs to verify domain ownership for Let’s Encrypt.
Advanced Caddyfile Options
Custom Headers
IP Allowlist
Basic Auth (Additional Layer)
Nginx
Configuration
Create/etc/nginx/sites-available/sparklytics:
Deployment Steps
Create configuration file
analytics.example.com with your domain.Nginx with Docker
If Sparklytics runs in Docker:Traefik
Traefik provides automatic HTTPS with Docker label-based configuration.docker-compose.yml with Traefik
[email protected] and analytics.example.com with your values.
Verification
After configuring your reverse proxy, verify everything works:Test SSL certificate
HTTP/2 200orHTTP/1.1 200- Valid SSL certificate (browser shows padlock)
Common Issues
502 Bad Gateway
502 Bad Gateway
Cause: Reverse proxy can’t reach Sparklytics.Fix:
- Verify Sparklytics is running:
docker ps - Check port is correct (default 3000)
- For Docker networks, use service name instead of localhost
Certificate errors
Certificate errors
Cause: Let’s Encrypt can’t verify domain ownership.Fix:
- Ensure DNS points to your server
- Ports 80 and 443 must be publicly accessible
- Check firewall rules
Login fails with reverse proxy
Login fails with reverse proxy
Cause: Cookies not being set correctly.Fix:
- Ensure
SPARKLYTICS_HTTPS=truewhen accessed over HTTPS - Verify
X-Forwarded-Protoheader is being set - Check
proxy_set_header Host $host;in Nginx config
Next Steps
HTTPS Setup
Deep dive into SSL/TLS configuration
Performance Tuning
Optimize for high-traffic deployments