Skip to content

Clarification: docs say transform rules cannot modify x-forwarded-for header #27811

@Crowley723

Description

@Crowley723

Existing documentation URL(s)

What changes are you suggesting?

Potentially remove or clarify the following:

You cannot modify the value of any header commonly used to identify the website visitor's IP address or initial protocol, such as x-forwarded-for, true-client-ip, x-real-ip, or x-forwarded-proto. Additionally, you cannot remove the x-forwarded-for and x-forwarded-proto headers.

However it is completely possible to create a Request Header Transform rule to remove the x-forwarded-for header at the cloudflare edge.

I can also confirm that the rule works as this request:
curl https://whoami.mydomain.com --resolve whoami.mydomain.com:443:172.67.150.59 -H "X-Forwarded-For: 1.2.3.4
Shows the x-forwarded-for header with the supplied value removed and the first ip as my ip.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions