关于curl命令报错:curl: (56) Received HTTP code 503 from proxy after CONNECT
今天在执行一个自动化脚本时,发现脚本返回如下错误:
[qq_5201351@localhost ~]# sh xx_auto_install_9.x.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (56) Received HTTP code 503 from proxy after CONNECT
分析了脚本的主要逻辑:
脚本中使用export定义了HTTP_PROXY及HTTPS_PROXY系统环境变量
然后再多处地址使用了curl访问https,第一处curl命令就报错了(curl使用了--tlsv1.2及--insecure选项)
+++++根据错误进行了如下几个步骤的排查分析
1、服务器到proxy服务器的端口连通(正常的)
2、DNS能否解析出curl的远端主机的IP(正常的)
3、最后看到返回的503错误,基本可以确认是服务端问题了
于是通知服务端负责人确认应用是否正常,那边解决后,脚本再次执行就正常了
尊重别人的劳动成果 转载请务必注明出处: