简体   繁体   English

为什么 cloudflare 阻止了我的 api 请求

[英]Why is cloudflare blocking my api request

I am trying to access the api https://api.btcxindia.com/order_book/ which is working fine in the browser however when I try to access it using file_get_contents or curl , i am getting Error 520, can someone tell why?我正在尝试访问在浏览器中运行良好的 api https://api.btcxindia.com/order_book/但是当我尝试使用 file_get_contents 或 curl 访问它时,我收到错误 520,有人能告诉我为什么吗?

Tried试过了

echo file_get_contents('https://api.btcxindia.com/order_book/'); 

And

curl 'https://api.btcxindia.com/order_book/' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.5' -H 'Connection: keep-alive' -H 'Host: api.btcxindia.com' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0'

Both do not work.两者都不起作用。

That is not CloudFlare blocking your request.这不是 CloudFlare 阻止您的请求。 Instead it is CloudFlare informing you that the API you are trying to access is offline.相反,它是 CloudFlare 通知您您尝试访问的 API 处于脱机状态。 This could either be due to the owner's misconfiguration of DNS or their server/hosting being down.这可能是由于所有者的 DNS 配置错误或他们的服务器/主机已关闭。

If you own the website you may want to confirm your website is online or the DNS is configured correctly.如果您拥有该网站,您可能需要确认您的网站在线或 DNS 配置正确。 If you do not own this website there is not much you can do but wait it out or contact the web administrator if you already know their contact details.如果您不拥有此网站,则无能为力,只能等待,或者如果您已经知道他们的联系方式,请联系网络管理员。

Edit: After discussing in the comments, it appears the website has a configuration error with a certain request type or certain clients.编辑:在评论中讨论后,网站似乎存在特定请求类型或特定客户端的配置错误。 This is likely what is causing your error and is likely a web server error.这很可能是导致您的错误的原因,并且很可能是 Web 服务器错误。

Regards问候

New policies on Cloudflare: https://developers.cloudflare.com/api-shield/ Cloudflare 的新政策: https ://developers.cloudflare.com/api-shield/

Availability可用性

Cloudflare API Security products are available to Enterprise customers only, though anyone can set up Mutual TLS with a Cloudflare-managed certificate authority. Cloudflare API 安全产品仅供企业客户使用,但任何人都可以使用 Cloudflare 管理的证书颁发机构设置 Mutual TLS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM