[英]OSX : Chrome cannot connect to .localhost-domains. Connection refused
This have me stumped.这让我很难过。
I have a local development setup running nginx + php-fpm where I'm using.localhost as working domain for each project.我有一个运行 nginx + php-fpm 的本地开发设置,其中我使用 .localhost 作为每个项目的工作域。 Yesterday Chrome stopped working with the local domains.昨天 Chrome 停止使用本地域。 Instead it just returns connection refused.相反,它只是返回连接被拒绝。 DevTools shows the error as (failed) net::ERR_CONNECTION_RESET
. DevTools 将错误显示为(failed) net::ERR_CONNECTION_RESET
。
Accessing http://127.0.0.1 works, but of course won't work with the local projects.访问http://127.0.0.1有效,但当然不适用于本地项目。
Safari continues to work with.localhost. Safari 继续使用 .localhost。
Chrome: Version 90.0.4430.212 (Official Build) (x86_64) OS: macOS 11.4 (20F71) Chrome:版本 90.0.4430.212(官方构建)(x86_64) 操作系统:macOS 11.4 (20F71)
Tried several different things like:尝试了几种不同的方法,例如:
chrome://net-internals/#dns
为 Chrome 清除 DNS chrome://net-internals/#dns
chrome://net-internals/#hsts
从chrome://net-internals/#hsts
删除域Solution was found after creating a netlogs from chrome://net-internals/#events and then looking at the different events.从 chrome://net-internals/#events 创建一个网络日志,然后查看不同的事件后,找到了解决方案。 Found this:发现这个:
t=18295 [st=0] +SOCKET_ALIVE [dt=4]
--> source_dependency = 5112 (TRANSPORT_CONNECT_JOB)
t=18295 [st=0] +TCP_CONNECT [dt=1]
--> address_list = ["[::1]:80","127.0.0.1:80"]
--> canonical_name = ""
t=18295 [st=0] TCP_CONNECT_ATTEMPT [dt=1]
--> address = "[::1]:80"
t=18296 [st=1] -TCP_CONNECT
--> source_address = "[::1]:56378"
t=18296 [st=1] +SOCKET_IN_USE [dt=3]
--> source_dependency = 5111 (HTTP_STREAM_JOB)
t=18296 [st=1] SOCKET_BYTES_SENT
--> byte_count = 719
t=18298 [st=3] SOCKET_READ_ERROR
--> net_error = -101 (ERR_CONNECTION_RESET)
--> os_error = 54
t=18299 [st=4] -SOCKET_IN_USE
t=18299 [st=4] SOCKET_POOL_CLOSING_SOCKET
--> reason = "Connection was closed when it was returned to the pool"
t=18299 [st=4] -SOCKET_ALIVE
Chrome seems to default to IPv6. Chrome 似乎默认使用 IPv6。
Solution Adding listen [::]:80 ipv6only=off;
解决方案添加listen [::]:80 ipv6only=off;
to nginx site configuration and restarting nginx.到 nginx 站点配置并重新启动 nginx。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.