You likely need to change just the part having to do with the certificates.
Oh. Wait.
It sounds like recent changes to the way that the NGINX configuration is managed that this bit is now in a different file:
# do not redirect all hosts back to the main domain name
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /if \(\$http_host[^\}]*\}/m
to: ""
Yes. Here’s the new place:
I think that changing that filename to /etc/nginx/conf.d/outlets/server/20-https.conf will solve the redirect problem. You’ll also need to make the changes about how the certificate is requested, though if it’s working, I guess you might not need to change it.