Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c72a47

Browse files
committed
whitespace characters and line feeds
1 parent d5b042e commit 2c72a47

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

cookbook/cache/varnish.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,26 @@ that will invalidate the cache for a given resource:
179179
Routing
180180
------------------
181181

182-
To ensure that the Symfony Router generates urls correctly with Varnish, proper ```X-Forwarded``` headers must be added. Headers depend on how you have configured hosts and ports for the web server and Varnish but this example should work if the web server is using the same IP as Varnish but a different port (e.g. 8080).
182+
To 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).
183187

184188
.. code-block:: text
185189
186-
sub vcl_recv {
187-
if (req.http.X-Forwarded-Proto == "https" ) {
188-
set req.http.X-Forwarded-Port = "443";
189-
} else {
190-
set req.http.X-Forwarded-Port = "80"
191-
}
192-
}
190+
sub vcl_recv {
191+
if (req.http.X-Forwarded-Proto == "https" ) {
192+
set req.http.X-Forwarded-Port = "443";
193+
} else {
194+
set req.http.X-Forwarded-Port = "80"
195+
}
196+
}
193197
194198
.. note::
195199

196-
Remember to set framework.trust_proxy_headers: true in the Symfony configuration for this to work.
200+
Remember to set framework.trust_proxy_headers: true in the Symfony
201+
configuration for this to work.
197202

198203
.. _`Edge Architecture`: http://www.w3.org/TR/edge-arch
199204
.. _`GZIP and Varnish`: https://www.varnish-cache.org/docs/3.0/phk/gzip.html
200-

0 commit comments

Comments
 (0)