简体   繁体   English

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

[英]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.

相关问题 curl:(28)无法连接到raw.githubusercontent.com端口443:连接超时 - curl: (28) Failed to connect to raw.githubusercontent.com port 443: Connection timed out 无法在端口80和443上访问Kubernetes节点 - Kubernetes node is not accessible on port 80 and 443 推送到远程存储库时“无法连接到 github.com 端口 443:连接超时” - "Failed to connect to github.com port 443: Connection timed out" when pushing to remote repository 无法在端口80或443上运行node.js Web服务 - cannot run node.js webservice on port 80 or 443 在Django中分叉后关闭TCP端口80和443 - Close TCP port 80 and 443 after forking in Django 在443端口上使用SSL运行节点应用(在80上正在运行) - Run node app with SSL on 443 port (on 80 is working) 已解决将所有请求从端口 80 重定向到 443 - SOLVED Redirect all requests from port 80 to 443 您在标准 HTTP(80) 端口上配置了 HTTPS(443) - You configured HTTPS(443) on the standard HTTP(80) port 尝试在Linux Centos 6的端口80/443上运行AolServer - trying to run AolServer on port 80/443 on linux Centos 6 docker 容器:curl:(7)无法连接到 172.17.0.1 端口 4000:没有到主机的路由 - docker container: curl: (7) Failed to connect to 172.17.0.1 port 4000: No route to host
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM