Performance: real visitor IP
Why your server sees CDN addresses instead of visitors' IPs, and how to read the real IP from the request headers.
What it is
Tuurbo runs its optimizations on the nodes of the Cloudflare CDN, before the traffic reaches your server. For this to work the record must pass through the CDN (proxy active): you turn this on with Activate Tuurbo in DNS.
A side effect: your server receives requests from the CDN, so in logs and analytics it sees CDN addresses (for example 172.70.114.153) instead of your visitors' IPs.
Where the real IP is
The real IP is not lost: it travels in an HTTP header.
CF-Connecting-IP: always present.True-Client-IP: optional, available on Enterprise configurations.
How to read it
PHP
$real_ip = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? $_SERVER['REMOTE_ADDR'];
NGINX
set_real_ip_from 172.70.0.0/16;
real_ip_header CF-Connecting-IP;
Add a set_real_ip_from line for each Cloudflare IP range: the official list is in the Cloudflare guide "Restoring original visitor IPs".
Proxy active or DNS only
| Mode | What happens |
|---|---|
| Proxy active | Traffic goes through the CDN: Tuurbo optimizes, caches and protects. The server sees CDN IPs. |
| DNS only | Traffic goes straight to your server: no Tuurbo optimization is applied. |
What we recommend
- Make sure applications, logs and security plugins read
CF-Connecting-IP. - Do not use
REMOTE_ADDRalone to identify users or block IPs. - This applies to every site behind a CDN or reverse proxy, not only Tuurbo.
Common problems
| Problem | What to check |
|---|---|
| All visits come from the same IP | The site reads REMOTE_ADDR: switch to CF-Connecting-IP. |
| A security plugin blocks real users | Configure the plugin to trust the CDN header. |
| Optimizations are not applied | Check that Activate Tuurbo is on for the record. |
Related pages
Related topics
Was this page helpful?