Redirection to https:// won't work when Let's encrypt is enabled and hsts_include_subdomains is false

I believe this problem has the same root cause as this thread. Try removing letsencrypt-example.com.conf from the server then run

sudo service nginx reload

That conf file is used temporarily for the letsencrypt role and is normally removed except in a few specific failure cases.

If your Trellis version already has the changes in roots/trellis#743 (added to prevent this problem), Trellis will remove letsencrypt-example.com.conf if you just run:

ansible-playbook server.yml -e env=production --tags wordpress
1 Like