What is the CF-RAY header?

The CF-RAY header is added to help with tracing a request to a website through CloudFlare's network. You can use the ID when working with CloudFlare Support to help troubleshoot any related issues you may have with connectivity. At the same time, you can reveal this "Ray ID" in your logs by making some edits to configuration files in Apache and nginx.

 

For Apache:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" (%{CF-Ray}i)" cf_custom
CustomLog log/access_log cf_custom

For nginx:

log_format cf_custom '$remote_addr - $remote_user [$time_local]  '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent"'
                    '$http_cf_ray';

access_log  /var/log/nginx/access.log cf_custom;
Have more questions? Submit a request

Comments

Article is closed for comments.