Skip to content

[3.3] Finishing setTrustedProxies() changes & trusted_proxies removal #7952

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

Merged
merged 6 commits into from
May 30, 2017
Merged

[3.3] Finishing setTrustedProxies() changes & trusted_proxies removal #7952

merged 6 commits into from
May 30, 2017

Conversation

weaverryan
Copy link
Member

@weaverryan weaverryan commented May 27, 2017

Finishes #7868 and closes #7671

@@ -336,3 +336,4 @@
/components/dependency_injection/autowiring /service_container/autowiring
/event_dispatcher/class_extension /event_dispatcher
/security/target_path /security
/components/http_foundation/trusting_proxies /request/load_balancer_reverse_proxy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing trailing newline

:ref:`How to Configure Symfony to Work behind a Load Balancer or a Reverse Proxy <request-untrust-header>`.
Remember to call the :ref:`Request::setTrustedProxies() <request-set-trusted-proxies>`
method in your front controller so that Varnish is seen as a trusted proxy
and the :ref:`X-Forwarded <varnish-x-forwarded-headers>` headers are used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X-Forward-*?

@@ -183,44 +182,13 @@ named ``kernel.http_method_override``.
$request = Request::createFromGlobals();
// ...


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be reverted

xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
// tell Symfony about your revers proxy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverse


.. code-block:: php
// or, if your proxy instead uses the "Forwarded" header
// Request::HEADER_FORWARDED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also mention the HEADER_X_FORWARDED_AWS_ELB constant

@xabbuh
Copy link
Member

xabbuh commented May 27, 2017

👍

just some minor comments

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ryan, thanks for taking care of this important update. I like it a lot!

http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
// tell Symfony about your revers proxy
Request::setTrustedProxies(
// the ip address (or range) of your proxy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ip address -> IP address

using HTTPS.
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``).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this part: ... so you can also pass your own value (e.g. 0b00110) Don't you think that'd be super confusing and hard to maintain?

@weaverryan weaverryan merged commit c7087bf into symfony:3.3 May 30, 2017
weaverryan added a commit that referenced this pull request May 30, 2017
…roxies removal (JarJak, xabbuh, weaverryan)

This PR was merged into the 3.3 branch.

Discussion
----------

[3.3] Finishing setTrustedProxies() changes & trusted_proxies removal

Finishes #7868

Commits
-------

c7087bf tweaks thanks to review
45b419d Adding second argument to setTrustedProxies() and removing old information
2f83164 replace trusted_proxies reference
3632c08 replace diff code block with PHP code block
1825c83 Remove deprecated trusted_proxies config option
df63034 Remove deprecated trusted_proxies config option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants