@@ -137,27 +137,29 @@ these (see ":doc:`/components/http_foundation/trusting_proxies`").
137
137
138
138
The code for doing this will need to live in your front controller (e.g. ``web/app.php ``).
139
139
140
- My Reverse Proxy Does not Provide All the Standards Headers
141
- -----------------------------------------------------------
140
+ .. _my-reverse-proxy-does-not-provide-all-the-standards-headers :
141
+
142
+ My Reverse Proxy Does not Provide All the Standard Headers
143
+ ----------------------------------------------------------
142
144
143
145
AWS Elastic Load Balancing for example does not provide the ``X-Forwarded-Host ``
144
146
and ``X-Forwarded `` HTTP headers, so you must make the following changes in the
145
- front controller::
147
+ front controller:
146
148
147
- .. code-block:: diff
149
+ .. code-block :: diff
148
150
149
- // web/app.php
151
+ // web/app.php
150
152
151
- // ...
152
- $request = Request::createFromGlobals();
153
- // be very careful with the next line; see "But what if the IP of my Reverse Proxy Changes Constantly!"
154
- + Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
155
- // the next line is needed because AWS ELB doesn't send X-Forwarded-Host
156
- + Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, null);
157
- // the next line is needed because AWS ELB doesn't use RFC 7239
158
- + Request::setTrustedHeaderName(Request::HEADER_FORWARDED, null);
153
+ // ...
154
+ $request = Request::createFromGlobals();
155
+ // be very careful with the next line; see "But what if the IP of my Reverse Proxy Changes Constantly!"
156
+ + Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
157
+ // the next line is needed because AWS ELB doesn't send X-Forwarded-Host
158
+ + Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, null);
159
+ // the next line is needed because AWS ELB doesn't use RFC 7239
160
+ + Request::setTrustedHeaderName(Request::HEADER_FORWARDED, null);
159
161
160
- // ...
162
+ // ...
161
163
162
164
.. _`security groups` : http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html
163
165
.. _`RFC 7239` : http://tools.ietf.org/html/rfc7239
0 commit comments