My domain doesn't allow connection (ERR_CONNECTION_REFUSED)


I have a weird problem. I set up my droplet and domain yesterday. I bought the domain on Hover and redirect it to Digital Ocean name servers. I’m using Nginx and Ubuntu 16.04. Everything worked fine but after some hours, I had this error when trying to access my website: doesn't allow connection... ERR_CONNECTION_REFUSED. I don’t always get that error but only sometimes. Another weird thing is sometimes, the Hover default web page is displayed as if the DNS is not propagated yet. I don’t see any error when analyzing my SSL with There is no error when I run sudo nginx -t. But I have this error in /var/log/nginx/error.log:
2017/04/13 11:57:20 [crit] 29675#29675: *389 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client:, server:


server {
	listen 80 default_server;
	listen [::]:80 default_server;
        return 301 https://$server_name$request_uri;

server {

	# SSL configuration
	listen 443 ssl http2 default_server;
	listen [::]:443 ssl http2 default_server;
	include snippets/;
        include snippets/ssl-params.conf;
	# Note: You should disable gzip for SSL traffic.
	# See:
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See:
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	# include snippets/snakeoil.conf;

	root /var/www/html;

	# Add index.php to the list if you are using PHP
	index index.php  index.html index.htm index.nginx-debian.html;


	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;

	# pass the PHP scripts to FastCGI server listening on
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
	#	# With php7.0-cgi alone:
	#	fastcgi_pass;
	#	# With php7.0-fpm:
		fastcgi_pass unix:/run/php/php7.0-fpm.sock;

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	location ~ /\.ht {
		deny all;

        location ~ /.well-known {
                allow all;

ssl_certificate /etc/letsencrypt/live/;
ssl_certificate_key /etc/letsencrypt/live/;


# from
# and

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver valid=300s;
resolver_timeout 5s;
# Disable preloading HSTS for now.  You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

ssl_dhparam /etc/ssl/certs/dhparam.pem;


It seems that you now have it working. Congrats.
You are getting a good “A” score on the Qualsys SSL test:

I don’t see a “Strict-Transport-Security” header at the moment. More details here?


I was getting A+ even before making some changes. Today I changed my cipher listing to allow backwards compatibility. I also removed Strict Transport Security because I thought it could be the problem.


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