-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Documented how to configure Symfony correctly with regards to the Forwarded header #6526
Conversation
your reverse proxy is not handling the Forwarded header the way Symfony expects it to.
@@ -24,6 +24,21 @@ Remember to configure :ref:`framework.trusted_proxies <reference-framework-trust | |||
in the Symfony configuration so that Varnish is seen as a trusted proxy and the | |||
:ref:`X-Forwarded <varnish-x-forwarded-headers>` headers are used. | |||
|
|||
Varnish, in its' default configuration, sends the ``X-Forwarded-For`` header but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its'
-> its
👍 nice additions to an important topic which is probably underdocumented. Thanks @magnusnordlander |
Varnish, in its default configuration, sends the ``X-Forwarded-For`` header but | ||
does not filter out the ``Forwarded`` header. If you have access to the Varnish | ||
configuration file, you can configure Varnish to remove the ``Forwarded`` | ||
header:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the colons needs to be removed to make the build happy. :)
👍 |
stored in a ``X-Forwarded-Host`` header. | ||
headers or the ``Forwarded`` header. For example, the ``Host`` HTTP header is | ||
usually used to return the requested host. But when you're behind a proxy, | ||
the true host may be stored in a ``X-Forwarded-Host`` header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe replace "true host" with "actual host" here? (my dev. mind strongly binds true to a boolean value)
Thanks @magnusnordlander! I've left a lot of very minor comments. It would be great if you can fix these, otherwise we'll do it while merging. |
…s to the Forwarded header (magnusnordlander) This PR was squashed before being merged into the 2.7 branch (closes #6526). Discussion ---------- Documented how to configure Symfony correctly with regards to the Forwarded header | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | >2.7 | Fixed tickets | Ref: symfony/symfony#18688 Commits ------- 87ab598 Documented how to configure Symfony correctly with regards to the Forwarded header
Thank you @magnusnordlander! I have squashed your commits while merging and made some minor tweaks in 574afd5. |
* 2.7: [#6526] some minor tweaks Documented how to configure Symfony correctly with regards to the Forwarded header Improved the description of the Twig global variables Add a warning about using same user for cli and web server Correctly document new twig functions Updated Twig template to take into account asset() function changes [DependencyInjection] Unquote services FQCN in parent-services examples
* 2.8: [#6526] some minor tweaks Documented how to configure Symfony correctly with regards to the Forwarded header Improved the description of the Twig global variables Add a warning about using same user for cli and web server Correctly document new twig functions Updated Twig template to take into account asset() function changes [DomCrawler] Removed references to CssSelector [DependencyInjection] Unquote services FQCN in parent-services examples [DependencyInjection] Unquote services FQCN in autowiring examples
* 3.0: [#6526] some minor tweaks Documented how to configure Symfony correctly with regards to the Forwarded header Improved the description of the Twig global variables Add a warning about using same user for cli and web server Correctly document new twig functions Updated Twig template to take into account asset() function changes [DomCrawler] Removed references to CssSelector [DependencyInjection] Unquote services FQCN in parent-services examples [DependencyInjection] Unquote services FQCN in autowiring examples
…nd X-Forwarded-For (magnusnordlander) This PR was squashed before being merged into the 2.7 branch (closes #18688). Discussion ---------- [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#6526 Emit a warning when a request has both a trusted Forwarded header and a trusted X-Forwarded-For header, as this is most likely a misconfiguration which causes security issues. Commits ------- ee8842f [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For
…nd X-Forwarded-For (magnusnordlander) This PR was squashed before being merged into the 2.7 branch (closes #18688). Discussion ---------- [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#6526 Emit a warning when a request has both a trusted Forwarded header and a trusted X-Forwarded-For header, as this is most likely a misconfiguration which causes security issues. Commits ------- ee8842f [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For
…nd X-Forwarded-For (magnusnordlander) This PR was squashed before being merged into the 2.7 branch (closes #18688). Discussion ---------- [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#6526 Emit a warning when a request has both a trusted Forwarded header and a trusted X-Forwarded-For header, as this is most likely a misconfiguration which causes security issues. Commits ------- ee8842f [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For
…nd X-Forwarded-For (magnusnordlander) This PR was squashed before being merged into the 2.7 branch (closes #18688). Discussion ---------- [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#6526 Emit a warning when a request has both a trusted Forwarded header and a trusted X-Forwarded-For header, as this is most likely a misconfiguration which causes security issues. Commits ------- ee8842f [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For
Ref: symfony/symfony#18688