Mondoze Knowledge Base

Search our articles or browse by category below

How do I check my server’s response directly without Cloudflare?

Last modified: October 11, 2022
You are here:
Estimated reading time: 1 min

How do I check my server's response directly without Cloudflare?

When troubleshooting an issue with an HTTP response from Cloudflare, often your origin server may be the cause of this. Therefore, it is useful to request the same URL directly from your server to compare with the response from Cloudflare. In these examples, the domain is example.com and the IP address for the origin server is 123.123.123.123
 
First of all, to do this you’ll need to identify the IP address of your origin server – if you don’t know this already you can find this in your Cloudflare DNS settings by looking at the DNS records for your domain. We’re going to use the command-line tool cURL here to check your server’s response. For full information on the options available, take a look at the cURL manual page.
 

curl (versions 7.21.3 and newer)

curl --silent --verbose //example.com/example-url/here --resolve example.com:443:123.123.123.123 --insecure

If you wanted to use HTTP instead of HTTPS, you would change the URL to https:// and also the Port number in the --resolve the argument would change from 443 to 80

Note we have included the --insecure flag in this command as it skips cURL’s default behaviour of validating the SSL certificate presented by your server. If you have a valid certificate installed, you can remove this flag.

The --resolve the flag allows you to neatly force a request to a specific IP address, but some older versions of cURL don’t support it. If absolutely necessary, you can use a different way of doing this.

curl (versions 7.21.2 and older)

curl --silent --verbose //123.123.123.123/example-url/here --header "Host: example.com"

The resulting output from cURL will show you the full HTTP response. Including headers direct from your origin server’s IP address – removing Cloudflare from the equation entirely. Therefore if you still see the issue you’re experiencing with this output. You can be sure you’ll need to investigate what is happening on your server. As the issue is not caused by Cloudflare. If it’s not obvious what the next step is from here, contacting your hosting provider for assistance is the best way forward.

Was this article helpful?
Dislike 0
Views: 147