Skip to content

[HttpFoundation] 14114 header option 'X-Forwarded-Prefix' #15910

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

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions deployment/proxies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ and what headers your reverse proxy uses to send information:
# the IP address (or range) of your proxy
trusted_proxies: '192.0.0.1,10.0.0.0/8'
# trust *all* "X-Forwarded-*" headers
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port']
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix']
# or, if your proxy instead uses the "Forwarded" header
trusted_headers: ['forwarded']

Expand All @@ -59,6 +59,7 @@ and what headers your reverse proxy uses to send information:
<framework:trusted-header>x-forwarded-host</framework:trusted-header>
<framework:trusted-header>x-forwarded-proto</framework:trusted-header>
<framework:trusted-header>x-forwarded-port</framework:trusted-header>
<framework:trusted-header>x-forwarded-prefix</framework:trusted-header>

<!-- or, if your proxy instead uses the "Forwarded" header -->
<framework:trusted-header>forwarded</framework:trusted-header>
Expand All @@ -75,7 +76,7 @@ and what headers your reverse proxy uses to send information:
// the IP address (or range) of your proxy
->trustedProxies('192.0.0.1,10.0.0.0/8')
// trust *all* "X-Forwarded-*" headers (the ! prefix means to not trust those headers)
->trustedHeaders(['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port'])
->trustedHeaders(['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix'])
// or, if your proxy instead uses the "Forwarded" header
->trustedHeaders(['forwarded'])
;
Expand Down