Skip to content

docs(forward-auth): clarify that X-Forwarded-* carry the client request - #13978

Open
shreemaan-abhishek wants to merge 1 commit into
apache:masterfrom
shreemaan-abhishek:docs/forward-auth-forwarded-headers
Open

shreemaan-abhishek wants to merge 1 commit into
apache:masterfrom
shreemaan-abhishek:docs/forward-auth-forwarded-headers

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

Description

The X-Forwarded-* headers that forward-auth sends to the authorization service describe the request as the client sent it: the client's scheme, method, host, URI and source IP.

When proxy-rewrite is configured on the same route, the upstream receives the rewritten scheme, method, host and URI, while these headers keep carrying the client values. The docs listed the headers as bare names (X-Forwarded-Uri: URI), which makes that easy to miss when writing an authorization policy against upstream paths.

This clarifies the behaviour in both the English and Chinese docs, and documents how to forward the URI the upstream actually receives using extra_headers with $upstream_uri.

Docs only, no behaviour change.

Which issue(s) this PR fixes:

N/A

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

The X-Forwarded-* headers forward-auth sends describe the request as the
client sent it. When proxy-rewrite is enabled on the same route, the
upstream receives a rewritten scheme, method, host and URI while these
headers keep the client values, which is easy to miss when writing an
authorization policy.

Spell that out and document forwarding $upstream_uri via extra_headers
for policies keyed on the URI the upstream actually receives.
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