Setting up Discourse

That may be a letsencrypt issue. I found this tip quite useful to certify both www and non-www: