Multiple canonical domains

I defined multiple canonical domains (on purpose, WordPress site will show different page for each domain), each with own redirects.
The redirects and certificate configuration work correctly, but visiting one of the extra canonoical domains result in the nginx greeting page.

Unlisting until details are provided:

  • What version of Trellis are you using?
  • Show the actual modifications you’ve made.

@ben:

  • Latest trellis master just merged in and reapplied playbook.
  • wordpress_sites.yml config:
  example.com:
    site_hosts:
      - canonical: www.example.com
        redirects:
          - example.com
      - canonical: www.test1-example.com
        redirects:
          - test1-example.com
      - canonical: www.test2-example.com
        redirects:
          - test2-example.com
      - canonical: www.test3-example.com
        redirects:
          - test3-example.com
      - canonical: www.test4-example.com
        redirects:
          - test4-example.com
      - canonical: www.test5-example.com
        redirects:
          - test5-example.com
    local_path: ../../example/site # path targeting local Bedrock site directory (relative to Ansible root)
    repo: /share/application/example # replace with your Git repo URL
    repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo
    branch: master
    admin_email: info@example.com
    multisite:
      enabled: false
    ssl:
      enabled: true
      provider: letsencrypt
    cache:
      enabled: true
    # Custom wordpress site config child template!
    nginx_wordpress_site_conf: nginx-includes/example.com/wordpress-site.conf.child

nginx include wordpress-site.conf.child used by that site:

{% extends 'roles/wordpress-setup/templates/wordpress-site.conf.j2' %}

    {% block h5bp -%}
    include h5bp/directive-only/x-ua-compatible.conf;

    # Use relaxed extra security config to allow embedding in external sites:
    include h5bp-adjusted/directive-only/extra-security-relaxed.conf;

    include h5bp/location/cross-domain-fonts.conf;
    include h5bp/location/protect-system-files.conf;
    {%- endblock %}

1 Like

Apparently nginx failed to reload/restart because of syntax error, this is probably the reason, see:

The syntax issue was the reason for this.
Now it has been fixed.

WordPress still redirects to site_url, this I have to change in the plugin using filters.