Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cloudflare headers to set X-Client-IP #766

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Conversation

botimer
Copy link
Member

@botimer botimer commented Dec 5, 2024

When a service is directly exposed, we set the X-Client-IP to the connecting IP address. When proxying through Cloudflare, the originating IP address is set in the CF-Connecting-IP header, which we should use for the value instead.

This change also conducts a minor reordering of the template to keep the forwarded protocol next to the client IP header directive. This reordering is cosmetic only; the routing/access decisions are unchanged.

When a service is directly exposed, we set the X-Client-IP to the
connecting IP address. When proxying through Cloudflare, the originating
IP address is set in the CF-Connecting-IP header, which we should use
for the value instead.

This change also conducts a minor reordering of the template to keep the
forwarded protocol next to the client IP header directive. This
reordering is cosmetic only; the routing/access decisions are unchanged.
@botimer botimer merged commit 6d562b6 into production Dec 6, 2024
1 check passed
@botimer botimer deleted the cf-connecting-ip branch December 6, 2024 17:21
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.

2 participants