Make the example VCL stub ignore the port number.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 28 Nov 2015 12:03:19 +0000 (13:03 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 28 Nov 2015 12:03:19 +0000 (13:03 +0100)
doc/README

index ec68afaa5afe37cc1ae16329a58ba65c15426b33..2646d3e5f789f28d826777ef433a28d11e3ddbf4 100644 (file)
@@ -13,7 +13,7 @@ backend pr0n {
 }
 
 sub vcl_recv {
 }
 
 sub vcl_recv {
-    if (req.http.host == "pr0n.sesse.net") {
+    if (req.http.host ~ "^pr0n\.sesse\.net(:[0-9]+)?$") {
         set req.backend_hint = pr0n;
     }
 }
         set req.backend_hint = pr0n;
     }
 }
@@ -30,7 +30,7 @@ sub vcl_deliver {
 }
 
 sub vcl_backend_response {
 }
 
 sub vcl_backend_response {
-    if (bereq.http.host == "pr0n.sesse.net") {
+    if (bereq.http.host ~ "^pr0n\.sesse\.net(:[0-9]+)?$") {
         set beresp.ttl = 1w;
         set beresp.http.x-varnish-host = bereq.http.host;
         set beresp.http.x-varnish-url = bereq.url;
         set beresp.ttl = 1w;
         set beresp.http.x-varnish-host = bereq.http.host;
         set beresp.http.x-varnish-url = bereq.url;