Thanks for this very helpful guide! A couple of comments:
sudo apt-get install letsencrypt has been replaced with
sudo apt-get install certbot. Running the former, I get the notice
Note, selecting 'certbot' instead of 'letsencrypt'
A friend noticed that Facebook sharing of the site showed a preview of “301 moved permanently”.
Edit: I had originally replaced the
location / section of the port 80 server block with the
location / section of the port 443 server block. But I think that’s redundant. Instead I just deleted the port 80 server block, which served as a redirect block, and added:
in the appropriate section of the main server block.
I also enabled https redirect (not sure if that’s necessary) from within Discourse settings.
That fixed the issue with FB sharing, and it does seem as though regular HTTP requests are being redirected to HTTPS. If there is another or better method, please let me know.