Use Cloudflare only for some specific curl requests


Some sites (mostly hosted at OVH) cannot communicate with my website (hosted at Siteground) with CURL (error 28).
I have been working on this issue for months, nothing and no one has ever been able to solve the issue nor even identify its origin. Now I need to go forward and find a workaround.

I am wondering if Cloudflare could act as a proxy between the client’s site and my site:

  • Request: client’s site > Cloudflare > My site
  • Response: My site > Cloudflare > client’s site

In that case, I would like to use Cloudflare only for certain request (made by PHP code), I don’t want to all my traffic go through Cloudflare.

  • PHP requests (made by my code): curl_init( ‘my website’ ) => Through Cloudflare
  • Everything else: No Cloudflare

Is it possible? How to achieve this?

Thank you,

Welcome to the Cloudflare Community. :logodrop:

The curl error you reference is a timeout error. Whether the introduction of Cloudflare into the path would have a positive effect is hard to say. You would need to test it. Note that Cloudflare has its own timeout limitations.

If you are only seeking to proxy specific traffic, you will need to separate it into its own hostname or domain that can proxied while the rest of your site is not.

It may be worth putting more time into identifying the underlying cause of your errors before expending the effort into something that may not provide the resolution that you seek.