I ran this command: sudo certbot --authenticator webroot --installer nginx
getting and installing a certificate went fine, according to certbot
It produced this output:
If I don’t redirect I can still reach my server using http, but if I go to https:// it does not work and I get the following error in Chrome:
This site can’t be reached
dev.nilswesthoff.com unexpectedly closed the connection.
ERR_CONNECTION_CLOSED
My web server is (include version):
Home server (old desktop), running Ubuntu 16.04LTS with nginx, it’s behind my router. I port forwarded :80 and :443.
I can login to a root shell on my machine (yes or no, or I don’t know):
yes I can
Ah, didn’t actually check there. But there is a recurring one in nginx error.logs
2018/02/01 02:38:58 [error] 14991#14991: *124 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client [Not my IP here], server: 0.0.0.0:443
ufw is disabled on the server, the router should be the only thing stopping it by default (but I forwarded it, so it should work now)
Nginx is configured with at least one virtual host that has SSL enabled but doesn’t have a certificate (and private key) set. Either Certbot failed to configure it correctly, or there was an existing issue with a different server block.
You need to fix it, either adding certificates and keys to the affected server blocks, or disabling SSL in them.
“nginx -T” can display Nginx’s entire configuration.