You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cookbook/cache/varnish.rst
+14-10
Original file line number
Diff line number
Diff line change
@@ -179,22 +179,26 @@ that will invalidate the cache for a given resource:
179
179
Routing
180
180
------------------
181
181
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).
183
187
184
188
.. code-block:: text
185
189
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
+
}
193
197
194
198
.. note::
195
199
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
0 commit comments