Redirecting to wrong canonical address

I’ve just updated to the latest trellis using a new DO droplet.
Everything is working perfectly except for my www redirect specified in my wordpress_sites.yml

  - canonical:
  - canonical: is redirecting to instead of

My has this:

server {
  listen 80;

  server_name ;


server {
  listen 80;

  include acme-challenge-location.conf;

    location / {
      return 301 $scheme://$request_uri;

Any thoughts would be appreciated.

The looks correct. I presume it looks correct to you too, so I guess we’re both surprised by the redirect from to The second server block should match the the request and return 301 to

Were there any failures during initial provisioning?

Could you SSH in to the server and…

  • check the nginx config by running sudo nginx -t
  • reload nginx by running sudo service nginx reload
  • then test the redirect again, maybe even in a different browser (Chrome caches redirects)

I’m not familiar enough with the possibilities to catalogue them, but are there any other services involved that could be responsible for the redirect (DNS settings, caching proxies, etc.)?

Edit: Maybe turn rewrite_log on and check your logs

Thanks @fullyint - was just a caching issue. Will think to check other browsers in the future.

1 Like