Igor's Blog
Programming, DIY, Games, Hacks, and Tech

CloudFlare is a fantastic service and as I was moving one of my sites to use CloudFlare this weekend I wanted to know for sure if it was being served via the CloudFlare network or still from my web server. With a little bit of curl and looking at some HTTP headers this is very easy thing to check.

The following command will display all header information for a request to the site:
curl -sI https://yourwebsite.domain

The output looks similar to this when your site is not on CloudFlare, of course this will vary from server to server, the main point is there aren't any CloudFlare specific headers present:
 HTTP headers without CloudFlare
HTTP/1.1 200 OK
Date: Mon, 17 Apr 2017 07:03:58 GMT
Expires: Mon, 17 Apr 2017 07:13:58 GMT
Cache-Control: public, max-age=600
ETag: "OVVDww"
X-Cloud-Trace-Context: 4bc589fab4a319f41fb7aa2eeb7fcf81
Content-Type: text/html
Server: Google Frontend
Content-Length: 8714

Now once the site (or rather the DNS) switches over to CloudFlare the headers change to something like this...
 HTTP headers with CloudFlare
HTTP/1.1 200 OK
Date: Mon, 17 Apr 2017 07:04:14 GMT
Content-Type: text/html
Connection: keep-alive
Set-Cookie: __cfduid=d4161c4f0a3ddd95b561a8921dccecebf1492412654; expires=Tue, 17-Apr-18 07:04:14 GMT; path=/; domain=.yourwebsite.domain; HttpOnly
Expires: Mon, 17 Apr 2017 07:14:14 GMT
Cache-Control: public, max-age=600
X-Cloud-Trace-Context: d1a32aaff5d361cdfec9fd1e9cacaf57
Server: cloudflare-nginx
CF-RAY: 350d87709c3632a1-HKG

Specifically these are the new headers specific to CloudFlare...
 HTTP headers with CloudFlare
Set-Cookie: __cfduid=d4161c4f0a3ddd95b561a8921dccecebf1492412654; expires=Tue, 17-Apr-18 07:04:14 GMT; path=/; domain=.yourwebsite.domain; HttpOnly
Server: cloudflare-nginx
CF-RAY: 350d87709c3632a1-HKG

Out of all those new headers we only really care about the value for the Server header, so the following command is what we're really after:
curl -sI https://yourwebsite.domain | grep Server

Running that produces the following output and you can clearly see that the CloudFlare nginx server is being used to deliver your site's content.
 HTTP headers with CloudFlare
Server: cloudflare-nginx


comments powered by Disqus
Other posts you may like...

Recent Blog Posts

A hack to create an uber jar with the Maven Shade Plugin using local jar files

Is it worth it? Apple USB-C Digital Multi AV adapter vs a cheap eBay clone

Running X11 graphical applications after changing to another user using 'sudo su'

How to stop Facebook using ad images as post sharing thumbnails

Picking lists for Atari Lynx capacitor replacement kits

Performance - 2012 Retina MacBook Pro vs 2017 MacBook Pro

Look and feel - 2012 Retina MacBook Pro vs 2017 MacBook Pro

Using math to work out the diameter of hard to reach water cooling pipes

How to get the unreachable shard in the Hinterlands in DragonAge Inquisition

Measy RC12 wireless 2.4Ghz keyboard touchpad review

Recent Galleries

Monument Valley 2 is released and does not disappoint

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

DIY spare parts computer build with a RAIDMAX Anura case

Fake 'Lepin' brand Lego packaging

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

My Other Web Sites

Igor and Elise's Travels
Riverside Expressway Cam
300 George St Blogumentary

My Online Tools

UUID to OID Converter
Guru JSON-RPC Tester
Extrudifier Object Designer
Travel ┬ÁBlog

Blogs and Friends

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
Don't forget to
me for more great articles!
Don't show this again