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

Appearance settings

Commit def3df3

Browse filesBrowse files
committed
Merge branch '4.3' into 4.4
* 4.3: Fix filepath for Symfony 4.x #12117 Tweaks #12117 add support for custom headers when using a proxy
2 parents 051178e + 21e07cd commit def3df3
Copy full SHA for def3df3

File tree

1 file changed

+18
-0
lines changed
Filter options

1 file changed

+18
-0
lines changed

‎deployment/proxies.rst

Copy file name to clipboardExpand all lines: deployment/proxies.rst
+18Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.