返回顶部

curl: (52) Empty reply from server

curl: (52) Empty reply from server

背景原因:

编译nginx-1.18.0 后,在本机curl localhost 爆出如下信息,在其他服务器curl是正常响应200

# curl  localhost
# curl  localhost  -I
curl: (52) Empty reply from server

思路分析

首先判断是server端,网络,客户端因素。在其他客户端curl 一下服务端响应正常,应该是服务端做了限制,然后分析,server端配置极有可能是正向代理需要指定头部信息才能访问,询问网络组确认是正向代理导致,添加代理例外解决

# cat /etc/profile
#添加正向代理
http_proxy=http://10.1.16.xxx:8080
https_proxy=https://10.1.16.xxx:8080

#添加代理例外
no_proxy=10.1.xxx.xxx
export http_proxy https_proxy no_proxy

#验证

#curl 10.1.xxx.xxx -I
HTTP/1.1 200 OK
Server: Dadi source server
Date: Thu, 30 Jun 2022 09:10:53 GMT
Content-Type: image/png
Content-Length: 274016
Last-Modified: Thu, 30 Jun 2022 05:15:01 GMT
Connection: keep-alive
ETag: "62bd3155-42e60"
Accept-Ranges: bytes

总结

遇到问题,第一时间进行分析判断,一步步去分析去判断处理,问题不可怕一定要冷静去思考,有哪些情况会影响拆分去判断,最后再去验证即可。

 

posted @ 2022-06-30 17:18  九尾cat  阅读(18272)  评论(0编辑  收藏  举报