Https is working but http not working

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:

It produced this output: refused to connect.

My web server is (include version):

The operating system my web server runs on is (include version): node server, ubuntu

My hosting provider, if applicable, is: Digital Ocean

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):

Output for nginx -T
server {
# Enable HTTP/2
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Use the Let’s Encrypt certificates
ssl_certificate /etc/letsencrypt/live/;
ssl_certificate_key /etc/letsencrypt/live/;
# Include the SSL configuration from
include snippets/ssl-params.conf;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:8080/;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;

configuration file /etc/nginx/snippets/ssl-params.conf:

See for details on this configuration

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify on; # Requires nginx => 1.3.7
resolver valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security “max-age=63072000; includeSubDomains; preload”;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

Add our strong Diffie-Hellman group

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

1 Like

This should output all relevant configuration file contents, right? Where did your server {} block with listen 80; go? It should be there somewhere, but I can’t see it. Did you remove a configuration file perhaps?


@Osiris yeah if i tried to put block to listen 80 and then redirect to https. But with that I am getting error as too many redirects

1 Like

So you’ve removed the whole listen 80; server block? Well, there’s your problem… You need a server block with listen 80; for HTTP. Without it, nginx won’t do HTTP.


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