【发布时间】:2019-03-08 10:41:54
【问题描述】:
我正在尝试使用 curl 连接到站点,但它返回错误 503。
我想也许该网站阻止了我的 IP。我为我的 VPS 购买了另一个 IP 并使用此 IP 连接到该站点,但仍然无法连接并出现相同的错误。
我查看cURL 输出,发现我的两个请求具有相同的主 IP 但不同的本地 IP。
主 IP 不在我购买的 IP 列表中。 cURL 输出中的主 IP 代表什么?
Array (
[url] => http://adsl.tci.ir/
[content_type] => text/html; charset=UTF-8
[http_code] => 302
[header_size] => 366
[request_size] => 50
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.01543
[namelookup_time] => 0.004182
[connect_time] => 0.0057
[pretransfer_time] => 0.005737
[size_upload] => 0
[size_download] => 13458
[speed_download] => 872197
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.015135
[redirect_time] => 0
[redirect_url] => http://adsl.tci.ir/panel
[primary_ip] => 217.218.86.7
[certinfo] => Array ( )
[primary_port] => 80
[local_ip] => 185.208.174.63
[local_port] => 57646
)
【问题讨论】:
-
从命令提示符运行
ping adsl.tci.ir将解析为217.218.86.7作为目标 IP 地址。所以primary IP是您发送请求的地址。它是在 DNS 中映射到adsl.tci.ir的 IP 地址。因此,它不在您购买的 IP 地址列表中也就不足为奇了。 -
P.S.我尝试在浏览器中访问
http://adsl.tci.ir/panel并收到504 Gateway timeout错误 - 真的类似于您的 503 错误。我发送的ping请求也超时而没有得到响应。所以我怀疑这个网站只是离线。在花钱购买第二个 IP 地址之前,您是否尝试过从另一个地方(例如,只是您的本地计算机)对其进行测试?是什么让你得出你被屏蔽的结论?
标签: php http curl ip-address