Server closes connection while trying to reach https of site

My domain is:
dev.nilswesthoff.com

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

Hi @nilswesthoff,

Do you have any relevant messages in your nginx error logs?

Are you sure that there’s no host or network firewall anywhere along the chain blocking access to inbound port 443?

Have you ever previously had anything else on this server successfully listening on port 443?

something is listening on 443 - it just isn’t configured for TLS (properly)

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)

I’ve never tried running anything over ssl 443.

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.

1 Like

Yeah, got it! This helped me.

Thanks a bunch for your quick responses.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.