curl: (7) 无法连接到端口 80 和 443 - 在一个域上

Mit*_*tra 2 linux apache curl nginx

这个问题表明了研究的努力;它有用且清晰

我检查过 cURL 无法正常工作

当我运行命令时 curl -I https://www.example.com/sitemap.xml

curl: (7) Failed to connect

Failed to connect on all port
Run Code Online (Sandbox Code Playgroud)

此错误仅在一个域上,所有其他域工作正常,curl: (7) 无法连接到端口 80 和 443

谢谢...

Mit*_*tra 9

经过多次查找,发现Hosts设置不正确

然后我检查nano /etc/hosts 主机文件中的域指向错误的IP

我更改了错误的IP并且它工作正常

这是新错误相关 curl: (7) Failed to connect


Jai*_*osh 9

First Check your /etc/hosts file entries, may be the URL which You're requesting, is pointing to your localhost.

If the URL is not listed in your /etc/hosts file, then try to execute following command to understand the flow of Curl Execution for the particular URL:

curl --ipv4 -v "https://example.com/";
Run Code Online (Sandbox Code Playgroud)


cns*_*nst 5

curl: (7) Failed to connect\n
Run Code Online (Sandbox Code Playgroud)\n\n

上述错误消息意味着您的 Web 服务器(至少使用 指定的服务器curl)根本没有运行 \xe2\x80\x94 没有 Web 服务器在指定端口和指定(或隐含)端口上运行。(因此,XML 与此无关。)

\n