@@ -176,14 +176,20 @@ that will invalidate the cache for a given resource:
176176 }
177177 }
178178
179- Routing
180- ------------------
179+ Routing and X-FORWARDED Headers
180+ -------------------------------
181181
182182To ensure that the Symfony Router generates urls correctly with Varnish,
183- proper ```X-Forwarded` `` headers must be added. Headers depend on how you
184- have configured hosts and ports for the web server and Varnish but this
185- example should work if the web server is using the same IP as Varnish but
186- a different port (e.g. 8080).
183+ proper ```X-Forwarded` `` headers must be added so that Symfony is aware of
184+ the original port number of the request. Exactly how this is done depends
185+ on your setup. As a simple example, Varnish and your web server are on the
186+ same machine and that Varnish is listening on one port (e.g. 80) and Apache
187+ on another (e.g. 8080). In this situation, Varnish should add the ``X-Forwarded-Port ``
188+ header so that the Symfony application knows that the original port number
189+ is 80 and not 8080.
190+
191+ If this header weren't set properly, Symfony may append ``8080 `` when generating
192+ absolute URLs:
187193
188194..code-block ::text
189195
@@ -197,8 +203,9 @@ a different port (e.g. 8080).
197203
198204 ..note ::
199205
200- Remember to set ``framework.trust_proxy_headers: true `` in the Symfony
201- configuration for this to work.
206+ Remember to configure:ref: `framework.trusted_proxies<reference-framework-trusted-proxies> `
207+ in the Symfony configuration so that Varnish is seen as a trusted proxy
208+ and the ``X-Forwarded- `` headers are used.
202209
203210.. _`Edge Architecture` :http://www.w3.org/TR/edge-arch
204211.. _`GZIP and Varnish` :https://www.varnish-cache.org/docs/3.0/phk/gzip.html