DEV Community

Bartłomiej Stefański
Bartłomiej Stefański

Posted on • Originally published at bstefanski.com on

🛡️ Prevent Chrome from redirecting your HTTP localhost to HTTPS

Every time I tried setting up custom /etc/hosts for local development, chrome kept redirecting my service from HTTP to HTTPS.

<!-- -->Probably because there was already an existing website with the same hostname and SSL that I previously visited.

<!-- -->To fix that you need to go to chrome://net-internals/#hsts and put your service's URL in the input located under the Delete domain security policies section. Click delete and voilà!

Google chrome net internals page

Top comments (1)

Collapse
 
dinbtechit profile image
Dinesh

It works for a short period of time and then stops. It would be nice if we could permanently disable this.