NginX and cert not redirecting to HTTPS

My domain

My Nginx Configuration is this after running cert commands :

Although i have redirected the HTTP to HTTPS connection my website does not work if I type only. It works if I type

I have tried many configuration but none is working. Somehow Nginx not accepting my HTTP requests. I have posted before about my website that SSL throwing error on mobile network and then I actually found out that this is the issue. I am trying for 3 hours but no luck.

what does nginx -T shows? (capitalization matter)

It shwos syntax ok. No problem at all.

Hi @Yunus0or1

it’s the same picture shared there - SSL certificate thowing error on Mobile Network

Your http doesn’t work -

Domainname Http-Status redirect Sec. G -14 10.027 T
Timeout - The operation has timed out -14 10.027 T
Timeout - The operation has timed out 200 3.410 I 200 3.147 I

So your vHost configuration has some errors.

I have the same question - nginx -T.

big T, not small t. it’s different flag.

I let ufw allow Nginx Full. I do not know what conf I am missing here.

Sir , here is the link of full Nginx :

server {

if ($host = {
    return 301 https://$host$request_uri;
} # managed by Certbot**

if ($host = {
    return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;


return 301$request_uri;


remove marked part?

Works your http internal?

Something like



to check, if there is an answer.

No luck sir. I removed that part and reloaded nginx systemctl.

It returned this :

301 Moved Permanently

301 Moved Permanently

nginx/1.14.0 (Ubuntu)

That’s your answer. Then it is a firewall problem.

You must have a blocking instance.

PS: Checked your raw ip address, it’s the same ( ):

Domainname Http-Status redirect Sec. G -14 10.027 T
Timeout - The operation has timed out 400 2.780 N
Bad Request
Certificate error: RemoteCertificateNameMismatch

http is blocked.

Is it a regional filter?

I do not know whether it is Regional Filter or not. I ran my nginx server without cert commands and it worked fine with HTTP connections. No blocking and nothing. When I install lets encrypt SSL using cert commands then It just stops the HTTP connections although I have allowed Nginx Full in ufw


No, it’s a global problem.

All is red:

Must be a firewall or something else that blocks.

Or is it a home server, so your ISP blocks port 80?

Sir , pardon me. Give me 5 minutes. I will up my server without SSL config and show you that.

Sir you are 100% right. I checked my website with My own wifi and it redirected my to my HTTP connection properly. When I switched to a VPN it refused the connection. It is a home server and I do not know how to bypass this thing. Any advice for me sir ?

hsts preload you domain will browser to go stright to https version… but it’s totally overkill and would take too long untill deployed to browsers.
I guess you don’t have VPS available, right?

If your ISP blocks port 80, then you have no chance.

Ask your ISP.

No, nothing like that I own.