diff --git a/images/varnish-drupal/drupal.vcl b/images/varnish-drupal/drupal.vcl index e55f79f53f..44aa6ce2d8 100644 --- a/images/varnish-drupal/drupal.vcl +++ b/images/varnish-drupal/drupal.vcl @@ -65,6 +65,11 @@ sub vcl_recv { set req.http.X-LAGOON-VARNISH-BYPASS = "${VARNISH_BYPASS:-false}"; } + # Websockets are piped + if (req.http.Upgrade ~ "(?i)websocket") { + return (pipe); + } + if (req.http.X-LAGOON-VARNISH-BYPASS == "true" || req.http.X-LAGOON-VARNISH-BYPASS == "TRUE") { return (pass); } @@ -234,6 +239,14 @@ sub vcl_recv { return (hash); } +sub vcl_pipe { + # Support for Websockets + if (req.http.upgrade) { + set bereq.http.upgrade = req.http.upgrade; + set bereq.http.connection = req.http.connection; + } +} + sub vcl_hit { if (obj.ttl >= 0s) { # normal hit