[英]curl: (7) Failed to connect to port 80, and 443 - on one domain
This question shows research effort;这个问题显示了研究的努力; it is useful and clear
它有用且清晰
I have checked the cURL not working properly我检查了 cURL 不能正常工作
When I run the command curl -I https://www.example.com/sitemap.xml
当我运行命令
curl -I https://www.example.com/sitemap.xml
curl: (7) Failed to connect
Failed to connect on all port
this error only on one domain, all other domain working fine, curl: (7) Failed to connect to port 80, and 443仅在一个域上出现此错误,所有其他域均正常工作,curl:(7) 无法连接到端口 80 和 443
Thanks...谢谢...
First Check your /etc/hosts
file entries, may be the URL which You're requesting, is pointing to your localhost.首先检查您的
/etc/hosts
文件条目,可能是您请求的 URL,它指向您的本地主机。
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:如果您的
/etc/hosts
文件中未列出该 URL,请尝试执行以下命令以了解特定 URL 的 Curl 执行流程:
curl --ipv4 -v "https://example.com/";
After many search, I found that Hosts settings not correct经过多次搜索,我发现主机设置不正确
Then I check nano /etc/hosts
The Domain point to wrong IP in hosts file然后我检查
nano /etc/hosts
域指向 hosts 文件中的错误 IP
I change the wrong IP and its working Fine我更改了错误的 IP 并且它的工作正常
This is new error Related to curl: (7) Failed to connect
这是与 curl 相关的新错误
curl: (7) Failed to connect
curl: (7) Failed to connect
The above error message means that your web-server (at least the one specified with curl
) is not running at all — no web-server is running on the specified port and the specified (or implied) port.上面的错误信息意味着你的网络服务器(至少是用
curl
指定的那个)根本没有运行——没有网络服务器在指定的端口和指定的(或隐含的)端口上运行。 (So, XML doesn't have anything to do with that.) (因此,XML 与此无关。)
您可以使用浏览器下载密钥,然后在下载中打开终端,然后键入sudo apt-key add <key_name>.asc
Mine is Red Hat Enterprise(RHEL) Virtual Machine and I was getting something like the following.我的是红帽企业(RHEL)虚拟机,我得到了类似下面的东西。
Error "curl: (7) Failed to connect to localhost port 80: Connection refused"
I stopped the firewall by running the following commands and it started working.我通过运行以下命令停止了防火墙并开始工作。
sudo systemctl stop firewalld
sudo systemctl disable firewalld
If the curl
is to the outside world, like:如果
curl
是对外的,比如:
curl www.google.com
I have to restart my cntlm service:我必须重新启动我的 cntlm 服务:
systemctl restart cntlm
If it's within my.network:如果它在 my.network 中:
curl inside.server.local
Then a docker.network is overlapping something with my CNTLM proxy, and I just remove all docker.networks to fix it - you can also just remove the last.network you just created, but I'm lazy.然后 docker.network 与我的 CNTLM 代理重叠,我只是删除所有 docker.networks 来修复它 - 你也可以只删除你刚刚创建的 last.network,但我很懒。
docker network rm $(docker network ls -q)
And then I can work again.然后我可以再次工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.