2

I deployed a site but I cannot visit it due to HSTS.

I've tried contacting Namecheap, who I purchased the domain from, but they said the problem is with the hosting I am using. I am using surge.sh and have followed their custom domain instructions.

A picture of the error: site error

A picture of Namecheap: namecheap

I expect to be able to visit my site, but I cannot.

Some Guy
  • 351
  • 1
  • 4
  • 20

1 Answers1

2

The issue isn't the dns configuration. HSTS (HTTP Strict Transport Security) means that the site can only be accessed over an encrypted (HTTPS) connection. Probably due to using a TLD (top-level-domain) like *.dev that requires the use of HSTS. To make this work you need to set up a certificate on your host.

Apparently surge.sh provides free certificates for <my-subdomain>.surge.sh, but you'd need one for your custom domain and Securing your custom domain with SSL is part of surge plus. So you'd have to purchase it and follow the instructions or use a different host that works better for you.

I know many people like to use surge.sh as nice free host for static sites, but in this case you need their paid plan. There are other platforms that allow certificates for custom domains on the free plan though. I'm using netlify with custom domain and https myself on a free plan.

  • Thank you so much! Been at this for a few days, to tell you the truth. – Some Guy Jul 07 '19 at 14:03
  • I've lost a whole day with this. In my case I was trying to run a webserver with an autosigned certificate locally with Vagrant but it was impossible to access the site. Finally I just had to change my domain from mylocaldomain.dev to mylocaldomain.local which is not a TLD. – campsjos Oct 09 '19 at 15:33