Roots Discourse

how to? wildcard subdomain and letsencrypt

Hi there,

So I should start by saying that I’ve been using Trellis for months but none of my websites are Wordpress. They are all Laravel, I’ve adapted it and it’s worked very nicely.

I’m migrating from a server where I have a situation with a wildcard subdomain which then results in a redirect

For example going to something.mydomain.com redirects to mydomain.com/something

It’s not really a multisite scenario… just a wildcard capture and redirect. Cloudflare is already setup correctly.

Now I’m wondering how to setup Trellis to make this work so that the correct nginx config is generated and the correct wildcard letsencrypt cert is applied and set for automatic renewal

Is it as simple as adding this as my canonical / redirects ?

I also have many other unique subdomains such as admin.mydomain.com and forums.mydomain.com so I only want the wildcard to take affect when none of the other “real” subdomains match

  mydomain.com:
    site_hosts:
      - canonical: www.mydomain.com
        redirects:
          - *.mydomain.com
    nginx_root: 'current/public'
    db_create: false
    multisite:
      enabled: false
    ssl:
      enabled: true
      provider: letsencrypt

Thanks a lot for the great software!

Trellis doesn’t support wildcard certificates with Let’s Encrypt

heya Benword - is that still the case?

1 Like

Is there development on using wildcard domains with letsencrypt and roots? To which files would this compatibility get added?