I wonder if this part is needed, since we already have the “force https” option in Admin settings.
@brahn, this is your part of the code, can you explain why is this necessary?
- replace: filename: "/etc/nginx/conf.d/discourse.conf" from: /return 301 https.+/ to: | return 301 https://$host$request_uri;