Here’s how I set up SSL for my self-hosted Spwig store using Let’s Encrypt and Nginx. I run Spwig on a Hetzner VPS with Docker Compose, and this setup ensures secure HTTPS access for my partner’s jewelry shop.
Step 1: Configure Domain & SSL in Spwig Admin
Go to Settings > Site Settings > Domain & SSL. Enter your domain name and select Let’s Encrypt as the SSL mode. Enter your admin email address for certificate expiry notifications. Click Apply Configuration — Spwig will handle the rest automatically.
Step 2: Verify DNS and Port 80 Access
Make sure your domain’s A record points to your server’s IP address. Also, ensure port 80 is open on your firewall — this is needed for Let’s Encrypt to verify your domain.
Step 3: Configure Nginx to Enforce HTTPS
In your Nginx config (usually located in /etc/nginx/sites-available/), add the following to redirect HTTP traffic to HTTPS:
server {
listen 80;
server_name yourdomain.com;
location / {
return 301 https://$host$request_uri;
}
}
Reload Nginx with nginx -t && systemctl reload nginx to apply the changes.
Step 4: Automate Certificate Renewal
Let’s Encrypt certificates renew automatically every 60-90 days. I set up a cron job to run certbot renew --dry-run weekly to test the renewal process. This ensures I don’t get caught off guard if something goes wrong.
One thing to watch out for: always test your SSL setup after making changes. Use tools like SSL Labs’ SSL Test to verify everything is working correctly.