Learn to gather data to diagnose issues and facilitate troubleshooting with Cloudflare support. For most troubleshooting, Cloudflare strongly recommends generating a HAR file as a starting point.
Overview
It is important to capture as much information as possible to diagnose an issue and to provide adequate details to Cloudflare support. This article explains how to gather troubleshooting information commonly requested by Cloudflare Support.
Generate a HAR file
A HTTP Archive (HAR) records all web browser requests including the request and response headers, the body content, and the page load time.
Currently, only Chrome and Firefox can access the HAR feature by default. Other browsers either require a browser extension or cannot generate a HAR. When installing a browser extension, follow the instructions from the extension provider.
1. In a browser page, right-click anywhere and select Inspect Element.
2. The developer tools either appear at the bottom or left side of the browser. Click the Network tab.

3. Check Preserve log.
4. Click record.

5. Browse to the URL that causes issues. Once the issue is experienced, right click on any of the items within the Network tab and select Save all as HAR with Content.

6. Attach the HAR file to your support ticket.
1. From the application menu, select Tools > Web Developer > Network or press Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (OS X).
2. Browse to the URL that causes issues.
3. After duplicating the issue, right-click and choose Save All As HAR.
2. Browse to the URL that causes issues.
3. After duplicating the issue, click on Export as HAR followed by Save As....
1. In Safari, ensure a Develop menu appears at the top of the browser window. Otherwise, go to Safari > Preferences > Advanced and select Show Develop Menu in menu bar
2. Navigate to Develop > Show Web Inspector.
3. Browse to the URL that causes issues.
4. Ctrl + click on a resource within Web Inspector and click Export HAR.
Identify the Cloudflare data center serving your request
A map of our data centers is listed on the Cloudflare status page, sorted by continent. The three-letter code in the data center name is the IATA code of the nearest major international airport. Determine the Cloudflare data center serving requests for your browser by visiting: http://
www.example.com
/cdn-cgi/trace.
Replace www.example.com with your domain and hostname. Note the colo field from the output.
Troubleshoot requests with cURL
cURL is a command line tool for sending HTTP/HTTPS requests and is useful for troubleshooting:
- HTTP/HTTPS Performance
- HTTP Error Responses
- HTTP Headers
- APIs
- Comparing Server/Proxy Responses
- SSL Certificates
Run the following command to send a standard HTTP GET request to your website (replace www.example.com with your domain and host name):
curl -svo /dev/null http://www.example.com/
This example cURL command returns output detailing the HTTP response and request headers but discards the page body output. cURL output confirms the HTTP response and whether Cloudflare is currently proxying traffic for the site.
Expand the sections below for tips on troubleshooting HTTP errors, performance, caching, and SSL/TLS certificates:
When troubleshooting HTTP errors in responses from Cloudflare, test whether your origin caused the errors by sending requests directly to your origin web server. To troubleshoot HTTP errors, run a cURL directly to your origin web server IP address (bypassing Cloudflare’s proxy):
curl -svo /dev/null http://example.com --connect-to ::203.0.113.34
cURL measures latency or performance degradation for HTTP/HTTPS requests via the -w or --write-out cURL options. The example cURL below measures several performance vectors in the request transaction such as duration of the TLS handshake, DNS lookup, redirects, transfers, etc:
curl -svo /dev/null https://example.com/ -w "\nContent Type: %{content_type} \ \nHTTP Code: %{http_code} \ \nHTTP Connect:%{http_connect} \ \nNumber Connects: %{num_connects} \ \nNumber Redirects: %{num_redirects} \ \nRedirect URL: %{redirect_url} \ \nSize Download: %{size_download} \ \nSize Upload: %{size_upload} \ \nSSL Verify: %{ssl_verify_result} \ \nTime Handshake: %{time_appconnect} \ \nTime Connect: %{time_connect} \ \nName Lookup Time: %{time_namelookup} \ \nTime Pretransfer: %{time_pretransfer} \ \nTime Redirect: %{time_redirect} \ \nTime Start Transfer: %{time_starttransfer} \ \nTime Total: %{time_total} \ \nEffective URL: %{url_effective}\n" 2>&1
Explanation of this timing output is found on the Cloudflare blog.
cURL helps review the HTTP response headers that influence caching. In particular, review several HTTP headers when troubleshooting Cloudflare caching:
- CF-Cache-Status
- Cache-control/Pragma
- Expires
- Last-Modified
- S-Maxage
Reviewing Certificates with cURL
The following cURL command shows the SSL certificate served by Cloudflare during an HTTPS request (replace www.example.com with your domain and host name):
curl -svo /dev/null https://www.example.com/ 2>&1 | egrep -v "^{.*$|^}.*$|^* http.*$"
To display the origin certificate (assuming one is installed), replace 203.0.113.34 below with the actual IP address of your origin web server and replace www.example.com with your domain and host name:
curl -svo /dev/null https://www.example.com --connect-to ::203.0.113.34 2>&1 | egrep -v "^{.*$|^}.*$|^* http.*$"
Testing TLS Versions
If troubleshooting browser support or confirming what TLS versions are supported, cURL allows you to test a specific TLS version by adding one of the following options to your cURL:
- --tlsv1.0
- --tlsv1.1
- --tlsv1.2
- --tlsv1.3
Temporarily pause Cloudflare
Pause Cloudflare to send traffic directly to your origin web server instead of Cloudflare's reverse proxy. No Cloudflare services such as SSL or WAF are enabled for paused domains. An alternative to pausing Cloudflare globally is to grey-cloud the records receiving traffic in your Cloudflare DNS app.
To temporarily pause Cloudflare:
- Navigate to the Overview tab in the Cloudflare dashboard.
- Click Pause Cloudflare on Site at the bottom-right of the page under Advanced Actions.
Perform a traceroute
Traceroute is a network diagnostic tool that measures the route latency of packets across a network. Most operating systems support the traceroute command. If you experience connectivity issues with your Cloudflare-proxied website and ask Cloudflare Support for assistance, ensure to provide output from a traceroute.
Review the instructions below for running traceroute on different operating systems. Replace www.example.com with your domain and host name in the examples below:
1. Open the Start menu.
2. Click Run.
3. To open the command line interface, type cmd and then click OK.
4. At the command line prompt, type: For IPv4 -
> tracert www.example.com
For IPv6 -
> tracert -6 www.example.com
5. Press Enter.
6. You can copy the results to save in a file or paste in another program.
1. Open a terminal window.
2. At the command line prompt, type:
For IPv4 -
> traceroute www.example.com
For IPv6 -
> traceroute -6 www.example.com
3. You can copy the results to save in a file or paste in another program.
- Open the Network Utility application.
- Click the Traceroute tab.
- Type the domain or IP address in the appropriate input field and press Trace.
- You can copy the results to save in a file or paste in another program.
Alternatively, follow the same Linux traceroute instructions above when using the Mac OS terminal program.
Add the CF-RAY header to your logs
The CF-RAY header traces a website request through Cloudflare's network. Provide the CF-RAY of a web request to Cloudflare support when troubleshooting an issue. You can also add CF-RAY to your logs by editing your origin web server configuration with the snippet below that corresponds to your brand of web server:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %{CF-Ray}i" cf_custom
log_format cf_custom '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" ' '$http_cf_ray';
Related resources
- Contacting Cloudflare Support
- Troubleshooting Cloudflare HTTP 5XX errors
- Diagnosing network issues with MTR and traceroute
- cURL command line tool