Skip to content

Log the client IP Cloudflare forwards, not the edge address - #19

Merged
samth merged 1 commit into
racket:masterfrom
samth:log-cf-client-ip
Sep 23, 2026
Merged

samth merged 1 commit into
racket:masterfrom
samth:log-cf-client-ip

Conversation

@samth

@samth samth commented Sep 23, 2026

Copy link
Copy Markdown
Member

Requests proxied through Cloudflare arrive from an edge address, so
request-client-ip reported the proxy rather than the original client
and every logged request looked like it came from Cloudflare. Prefer
the CF-Connecting-IP header when it is present.

Note that the header can be forged by anything that reaches the server
directly, so this is only as trustworthy as the listening port.

Requests proxied through Cloudflare arrive from an edge address, so
`request-client-ip` reported the proxy rather than the original client
and every logged request looked like it came from Cloudflare.  Prefer
the CF-Connecting-IP header when it is present.

Note that the header can be forged by anything that reaches the server
directly, so this is only as trustworthy as the listening port.
@samth
samth merged commit 5673dca into racket:master Sep 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant