Curl to Cloudfare Proxy enabled URL with custom http header


Im currently configuring an API url for my mobile application. As for debug purposes, the API URL is in IP address form bind with custom port (eg: SSL configuration was done using self signed cert only. The request includes a user define file that acts as header alongside with json application type and it must be included to obtain result.

My curl config:

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'api_header : '.$apifile,
‘Accept: application/json’,
‘Content-Type: application/json’

In order to protect my origin IP address from getting leaked publicly, I have decided to implement Cloudflare Proxy to the IP address. Using my working domain, i have added a subdomain to be pointed out to the origin IP of my API.

And of course i had to change the custom port 5564 bonded with localhost and create another proxy to bind to Cloudflare Proxy HTTPS port (eg: 8443) to

lets say:
Public API URL =
Origin API URL =

So after implementing Cloudflare Proxy to my API URL, i got an error api_header was not found or included with the request even though i have included it.

Kindly seek for an assistance on this matter.

This topic was automatically closed after 30 days. New replies are no longer allowed.