Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] add a private_ranges shortcut for trusted_proxies#19385

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall 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
11 changes: 11 additions & 0 deletionsdeployment/proxies.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,8 @@ 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'
# shortcut for private IP address ranges of your proxy
trusted_proxies:'private_ranges'
# trust *all* "X-Forwarded-*" headers
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
Expand All@@ -53,6 +55,8 @@ and what headers your reverse proxy uses to send information:
<framework:config>
<!-- the IP address (or range) of your proxy-->
<framework:trusted-proxies>192.0.0.1,10.0.0.0/8</framework:trusted-proxies>
<!-- shortcut for private IP address ranges of your proxy-->
<framework:trusted-proxies>private_ranges</framework:trusted-proxies>
<!-- trust *all* "X-Forwarded-*" headers-->
<framework:trusted-header>x-forwarded-for</framework:trusted-header>
Expand All@@ -75,13 +79,20 @@ and what headers your reverse proxy uses to send information:
$framework
// the IP address (or range) of your proxy
->trustedProxies('192.0.0.1,10.0.0.0/8')
// shortcut for private IP address ranges of your proxy
->trustedProxies('private_ranges')
// 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', 'x-forwarded-prefix'])
// or, if your proxy instead uses the "Forwarded" header
->trustedHeaders(['forwarded'])
;
};
..versionadded::7.1

``private_ranges`` as a shortcut for private IP address ranges for the
`trusted_proxies` option was introduced in Symfony 7.1.

..caution::

Enabling the ``Request::HEADER_X_FORWARDED_HOST`` option exposes the
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp