Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

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
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
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


-i

Please leave your comments or feedback below!
comments powered by Disqus
Other posts you may like...
Hi! You can search my blog here ⤵
Or browse the recent top tags...

Recent Blog Posts

WebLogic Maven Plugin - How to fix the MojoExecutionException: The artifact location was not specified

jPhotoFrame version 0.4 released with a whole new layout engine

Upcycling a couple of old broken lamps to create something amazing

A custom exception mapper and writer for a RESTful JAX-RS Jersey service

How to fix Plex error - Sorry there was a problem playing this item

Jersey JAX-RS filters and interceptors execution order for a POST request

Fix your Mac - users not showing on the macOS login screen when FileVault is enabled

BMB-012 Nanoblock T-Rex Skeleton Model assembly

Writing a custom MessageBodyReader to process POST body data with Jersey

How to make Skype for Business responsive again on macOS

Recent Galleries

BMB-012 Nanoblock T-Rex Skeleton Model assembly

Tiny Arcade revision 6 kit assembly and decal application

Atari Lynx repair - Part 5 - McWill LED screen mod installation

Atari Lynx repair - Part 4 - screen cover replacement

Atari Lynx repair - Part 2 - re-capping the motherboard

Atari Lynx repair - Part 3 - broken speaker replacement

Atari Lynx repair - Part 1 - introduction and case disassembly

Building a custom Atari Lynx game box storage shelf unit in a day

Protecting old Atari Lynx game boxes with snug fit plastic sleeves

Monument Valley 2 is released and does not disappoint

Blogs and Friends

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

Blog Activity

Blog Activity