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

Remove deprecated HEADER_X_FORWARDED_ALL header#14518

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
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletionsdeployment/proxies.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,22 @@ and what headers your reverse proxy uses to send information::
['192.0.0.1', '10.0.0.0/8'],

// trust *all* "X-Forwarded-*" headers
Request::HEADER_X_FORWARDED_ALL
Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO

// or, if your proxy instead uses the "Forwarded" header
// Request::HEADER_FORWARDED

// or, if you're usingAWS ELB
// or, if you're usinga wellknown proxy
// Request::HEADER_X_FORWARDED_AWS_ELB
// Request::HEADER_X_FORWARDED_TRAEFIK
);

.. caution::

Enabling the ``Request::HEADER_X_FORWARDED_HOST`` option exposes the
application to "`HTTP Host header attacks`_". Make sure the proxy really
send a ``x-forwarded-host`` header.

The Request object has several ``Request::HEADER_*`` constants that control exactly
*which* headers from your reverse proxy are trusted. The argument is a bit field,
so you can also pass your own value (e.g. ``0b00110``).
Expand DownExpand Up@@ -114,3 +121,4 @@ In this case, you'll need to set the header ``X-Forwarded-Proto`` with the value
.. _`security groups`: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html
.. _`CloudFront`: https://en.wikipedia.org/wiki/Amazon_CloudFront
.. _`CloudFront IP ranges`: https://ip-ranges.amazonaws.com/ip-ranges.json
.. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
2 changes: 1 addition & 1 deletionmigration.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -262,7 +262,7 @@ could look something like this::
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(
explode(',', $trustedProxies),
Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST
Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO
);
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp