If you’re running a self-hosted Spwig store, setting up SSL is crucial for security and customer trust. Here’s how I do it on my Hetzner VPS:
-
Use Let’s Encrypt: I use the
configure-domain.shscript that comes with Spwig. SSH into your server, navigate to your Spwig directory, and run./configure-domain.sh. It will ask for your domain name, verify DNS, update the store’s config, and automatically obtain a Let’s Encrypt certificate. -
Configure Nginx: I make sure my Nginx config enforces HTTPS. Here’s a snippet from my setup:
server {
listen 80;
server_name yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
# Other Nginx config...
}
- Verify SSL: After setup, I test the SSL configuration using browser tools like SSL Labs’ SSL Test to ensure everything is working properly.
One thing to watch out for: make sure your DNS is correctly pointing to your server and that port 80 is open for Let’s Encrypt’s validation process. Once set up, your store will be secure with HTTPS and the padlock icon in browsers.