What is the difference between `CF-Connecting-IP` and `X-Real-IP` and can they ever be empty?

Using it for a simple rate-limiting purpose and was wondering :)
6 Replies
kian
kian2y ago
HTTP request headers · Cloudflare Fundamentals docs
Cloudflare passes all HTTP request headers to your origin web server and adds additional headers as specified below.
Mozzy
MozzyOP2y ago
Is there a preference on which to use? It seems like CF-Connecting-IP is more standard
kian
kian2y ago
Functionally they're the same - CF-Connecting-IP is the usual go-to but there's no difference
Mozzy
MozzyOP2y ago
Okay thanks :) And can they ever be empty, or is that just not how it works?
Peps
Peps2y ago
If the request came from a browser/client, it should never be empty as far as I'm aware there are some type of requests coming from Cloudflare that don't have that header, such as health checks, early hints and some more I can't immediately remember
Mozzy
MozzyOP2y ago
Gotcha
Want results from more Discord servers?
Add your server