Set up Let’s Encrypt with multiple domains / redirects

EDIT: Found a fix, ignore all the below, but leaving here for future people. Leaving the fix at the very bottom.

Just stumbled upon this thread. So, my site is: forums.mysite.me. I have 3 domains in my NGINX config and my domain provider that I am using DNS CNAME’s for that are coming back as insecure:

mysite.me
www.mysite.me
forum.mysite.me (without the "s" if someone misspells or guesses the URL)

Do I use my base domain in the config that’s in the original post? Or how do I set it up for all 3?

after_ssl:
   # tell letsencrypt what additional certs to get
    - replace:
        filename: "/etc/runit/1.d/letsencrypt"
        from: /--keylength/
        to: "-d forums.mysite.me --keylength"
    - replace:
        filename: "/etc/runit/1.d/letsencrypt"
        from: /--fullchainpath/
        to: "-d forums.mysite.me  --fullchainpath"

I’m confused because the first “replace” section has a from: /--keylength/ and the one under it has from: /--fullchainpath/. So, do I make 2 entries like that for each of those 3 URLs I listed or?..Or would it be this?

after_ssl:
   # tell letsencrypt what additional certs to get
    - replace:
        filename: "/etc/runit/1.d/letsencrypt"
        from: /--keylength/
        to: "-d mysite.me -d www.mysite.me -d forum.mysite.me --keylength"
    - replace:
        filename: "/etc/runit/1.d/letsencrypt"
        from: /--fullchainpath/
        to: "-d mysite.me -d www.mysite.me -d forum.mysite.me  --fullchainpath"

^ Yes, the above box right here was the fix for multiple sites/LetsEncrypt. So excited.

1 Like