Chrome 自动升级后,本地项目都无法访问
症状
chrome地址栏输入:xxx.app,回车后页面显示结果:
This site can’t be reached
xxx.app refused to connect.
原因
chrome最新版强制http转向https
观察地址栏:会发现原来的xxx.app
被强制加上https://
变成https://xxx.app
解决
chrome浏览器地址栏输入:chrome://net-internals/#hsts
在该页面中搜索:Query HSTS/PKP domain
在其下方的 Domain 后面的输入框中输入自己无法访问的域名,比如:domain.app,点击Query进行查询,如果有类似下面的结果,说明该域名后缀无法使用http前缀。
Found:
static_sts_domain: app
static_upgrade_mode: FORCE_HTTPS
static_sts_include_subdomains: true
static_sts_observed: 1508821200
static_pkp_domain:
static_pkp_include_subdomains:
static_pkp_observed:
static_spki_hashes:
dynamic_sts_domain:
dynamic_upgrade_mode: UNKNOWN
dynamic_sts_include_subdomains:
dynamic_sts_observed:
dynamic_sts_expiry:
dynamic_pkp_domain:
dynamic_pkp_include_subdomains:
dynamic_pkp_observed:
dynamic_pkp_expiry:
dynamic_spki_hashes:
如果没有任何返回结果,代表该域名后缀可以直接使用http协议,比如:domain.test 亲测可用。
注:目前chrome中,dev和app都不可用。
另外,首次访问自己新修改的域名domain.test时,必须加上 http://
否则无法正确访问。
最后,如果你是使用的valet,并且不介意被强制转向https,可以在终端中输入:valet secure yourdomain
本作品采用《CC 协议》,转载必须注明作者和本文链接
哈哈,有效率
補充個小知識
根據 RFC 2606,只有
.test
、.example
、.invalid
與.localhost
四個域名是會被安全保留的,各測試用域名詳細使用方式可以參見 RFC 2606包括 Laravel 官方所使用的
.app
及.dev
都不是合規範的保留域名前陣子,Google 說要推.dev
的域名,嚇死一票開發者我最近也在纳闷这问题 怎么突然回家 测试项目无法访问了
救一命
之前记得有位网友是配置证书可以访问的
懒人办法,不使用app和dev后缀