8000 Merge branch '4.4' · symfony/symfony-docs@19b80a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19b80a9

Browse files
committed
Merge branch '4.4'
* 4.4: Fix filepath for Symfony 4.x #12117 Tweaks #12117 add support for custom headers when using a proxy
2 parents c55dd09 + def3df3 commit 19b80a9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

deployment/proxies.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,22 @@ That's it! It's critical that you prevent traffic from all non-trusted sources.
7676
If you allow outside traffic, they could "spoof" their true IP address and
7777
other information.
7878

79+
Custom Headers When Using a Reverse Proxy
80+
-----------------------------------------
81+
82+
Some reverse proxies (like `CloudFront`_ with ``CloudFront-Forwarded-Proto``) may force you to use a custom header.
83+
For instance you have ``Custom-Forwarded-Proto`` instead of ``X-Forwarded-Proto``.
84+
85+
In this case, you'll need to set the header ``X-Forwarded-Proto`` with the value of
86+
``Custom-Forwarded-Proto`` early enough in your application, i.e. before handling the request::
87+
88+
// public/index.php
89+
90+
// ...
91+
$_SERVER['HEADER_X_FORWARDED_PROTO'] = $_SERVER['HEADER_CUSTOM_FORWARDED_PROTO'];
92+
// ...
93+
$response = $kernel->handle($request);
94+
7995
.. _`security groups`: http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html
96+
.. _`RFC 7239`: http://tools.ietf.org/html/rfc7239
97+
.. _`CloudFront`: https://en.wikipedia.org/wiki/Amazon_CloudFront

0 commit comments

Comments
 (0)
0