Setting Up SSL on Spwig for a Self-Hosted Store

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:

  1. Use Let’s Encrypt: I use the configure-domain.sh script 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.

  2. 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...
}
  1. 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.

2 Likes

Thanks for the detailed setup, Tom! I’ve used Let’s Encrypt with Spwig on a few client VPS setups. One thing I’ve found helpful is automating the certificate renewal with a cron job — 0 0 1 * * /path/to/spwig/configure-domain.sh works well for me. Also, I make sure to test the renewal process manually first to avoid downtime. For one of our agency clients, we set up a systemd service to handle the renewal gracefully. Have you considered that approach?

Thanks, Tom! I remember struggling with SSL on WooCommerce — let’s encrypt was a nightmare. Glad Spwig makes it simpler. Any tips for redirecting old WooCommerce URLs after migration?