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: allodocteuronline.com 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 ssllabs.com. 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: 64.41.200.105, server: 0.0.0.0:443

/etc/nginx/sites-available/default

server {
	listen 80 default_server;
	listen [::]:80 default_server;
        server_name allodocteuronline.com www.allodocteuronline.com;
        return 301 https://$server_name$request_uri;
}

server {

	# SSL configuration
	
	listen 443 ssl http2 default_server;
	listen [::]:443 ssl http2 default_server;
	include snippets/ssl-allodocteuronline.com.conf;
        include snippets/ssl-params.conf;
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# 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;

	server_name allodocteuronline.com;

	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 127.0.0.1:9000
	#
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
	
	#	# With php7.0-cgi alone:
	#	fastcgi_pass 127.0.0.1:9000;
	#	# 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-allodocteuronline.com.conf

ssl_certificate /etc/letsencrypt/live/allodocteuronline.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/allodocteuronline.com/privkey.pem;

ssl-params.conf

# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 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:
https://www.ssllabs.com/ssltest/analyze.html?d=allodocteuronline.com&hideResults=on

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.