服务器更改后,Curl命令不会给出响应

时间:2017-08-02 09:00:14

标签: curl cloudflare

我的curl命令用于从此公共站点提供html响应,直到几天前link here

但是现在我没有得到任何HTML响应,即使它可以在浏览器中运行。他们说他们搬到了cloudflare。我如何知道服务器并使我的curl命令工作?这是我目前的卷曲输出(这是一个公共网站,所以任何人都可以尝试)

curl -v http://f7.masaladesi.com/login.php                                                                                                                                      ~
* STATE: INIT => CONNECT handle 0x800481c0; line 1034 (connection #-5000)
* Added connection 0. The cache now contains 1 members
*   Trying 104.25.171.117...
* STATE: CONNECT => WAITCONNECT handle 0x800481c0; line 1087 (connection #0)
* Connected to f7.masaladesi.com (104.25.171.117) port 80 (#0)
* STATE: WAITCONNECT => DO handle 0x800481c0; line 1229 (connection #0)
> GET /login.php HTTP/1.1
> User-Agent: Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))
> Host: f7.masaladesi.com
> Accept: */*
>
* STATE: DO => DO_DONE handle 0x800481c0; line 1314 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x800481c0; line 1441 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x800481c0; line 1454 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 02 Aug 2017 04:57:21 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Wed, 02 Aug 2017 05:57:21 GMT
< Location: https://f7.masaladesi.com/login.php
* Server cloudflare-nginx is not blacklisted
< Server: cloudflare-nginx
< CF-RAY: 387e74b4538488b4-BOM
<
* STATE: PERFORM => DONE handle 0x800481c0; line 1626 (connection #0)
* Connection #0 to host f7.masaladesi.com left intact
* Expire cleared

1 个答案:

答案 0 :(得分:1)

CloudFlare使用各种方法来尝试确定最终用户是否是真实的&#34;浏览器而非恶意;这主要是为了减轻DDoS攻击。

简而言之,无法可靠地编写对受CloudFlare保护的网站的访问权限。有各种临时解决方法涉及设置curl的用户代理和使用&#34; real&#34;浏览器在使用curl之前从给定的IP访问该站点,但它们往往会随着时间的推移而失败。

对于CloudFlare员工来说,只需here