Igor's Blog

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

comments powered by Disqus
Other posts you may like...
Programming, DIY, Games, Hacks, and Tech

Recent Blog Posts

Converting a CSV file containing commas in quotes to a pipe separated file using Awk and Bash

How to get Facybox gallery popup to work for images with dynamic URLs

jQuery UI Photoboxr plugin updated to version 0.2

Learn How to Add Disclaimer to All Outgoing Emails in Office 365

How to securely host your web site for free with Google Cloud and CloudFlare (part 3)

How to securely host your web site for free with Google Cloud and CloudFlare (part 2)

How to securely host your web site for free with Google Cloud and CloudFlare (part 1)

Beware of the subtle difference in date format strings between MySQL and SQLite

Postman reporting Unexpected 'N' error in response body

Adding extra shelves to the Ikea Detolf display cabinet

Recent Galleries

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

Good Friday Electronics fun Easter Bunny LED PCB Kit IBEABU-01.0

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
Please follow me for more great content!
     
Don't show this again