LetsEncrypted Node.js HTTPS Server inaccessible from browser. Why it won't load?

I secured NGINX with SSL following this tutorial:

I explicitly chose to redirect all requests to HTTPS.

Now, when visiting my webpage, it correctly redirects me to and shows the default NGINX text.

I want Express to run there, so I made this tiny script to test things out:

var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('/etc/letsencrypt/live/'),
  cert: fs.readFileSync('/etc/letsencrypt/live/'),
  ca: fs.readFileSync('/etc/letsencrypt/live/')

https.createServer(options, function (req, res) {
  res.end("hello world\n");

The page will not load at all. What am I doing wrong?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It sounds like https is set up properly but Nginx is not configured to use your Express app for requests for the https site. Can you share the contents of your configuration files in /etc/nginx/sites-enabled?