Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/varnish-websockets'
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Apr 19, 2018
2 parents e7545ce + 639e8b3 commit e76702d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions images/varnish-drupal/drupal.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e76702d

Please sign in to comment.