Manual SSL with multiple domains (WPML multilingual WordPress)

I have a multilingual WordPress site where each language uses its own TLD (example.com, example.de, example.nl). With Trellis, after every provision I need to manually edit nginx.conf to add all domains to server_name. How can I configure wordpress_sites to include all domains automatically? Also should i purchase multildomain SSL use advance Cloudflare certificate or something else.

wordpress_sites:
  example.com:
    site_hosts:
    - canonical: example.com
      redirects:
      - www.example.com
    local_path: ../site
    branch: main
    repo: [email protected]:***.git
    repo_subtree_path: site
    multisite:
      enabled: false
    ssl:
      enabled: true
      provider: manual
      cert: ~/ssl/example_com.pem
      key: ~/ssl/example_com.key

Every time when i provision the server I would have to go to nginx.conf and edit
server {
listen [::]:443 ssl; listen 443 ssl;
http2 on;
http3 off;
server_name example.com example.de example.nl www.example.com www.example.de www.example.nl;

server {
listen [::]:80;
listen 80;
server_name example.com example.de example.nl www.example.com www.example.de www.example.nl;

I do not know the specific requirements for your site, but Let’s Encrypt offers free certificates, including subdomains, multiple domains (as long as it can be validated), and automatic validation via ACME. Also Let’s Encrypt is directly supported by Trellis.

Each domain that should not be redirected, that is unique on its own (canonical) should be listed under site_hosts as its own canonical key, with optional redirects:

wordpress_sites:
  example.com: # some fitting site name, assuming example.com in this example
    site_hosts:
      - canonical: example.com
        redirects:
          - www.example.com
      - canonical: example.de
        redirects:
          - www.example.de
      - canonical: example.nl
        redirects:
          - www.example.nl
2 Likes

thank you. It worked