From 387a3a57c1457996a4acf03560d66db98ce698b6 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Thu, 3 Nov 2022 23:43:17 +0100 Subject: [PATCH] Simple config w/ planetposen & motd-larry backends --- default.vcl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 default.vcl diff --git a/default.vcl b/default.vcl new file mode 100644 index 0000000..7399d36 --- /dev/null +++ b/default.vcl @@ -0,0 +1,48 @@ +vcl 4.0; + +# Default backend definition. Set this to point to your content server. +backend motd-larry { + .host = "motd-larry.schleppe"; + .port = "3000"; +} + +backend plansetposen { + .host = "planetposen.schleppe"; + .port = "80"; +} + +sub vcl_recv { + # Happens before we check if we have this in cache already. + # + # Typically you clean up the request here, removing cookies you don't need, + # rewriting the request, etc. + + if (req.http.host == "motd-larry.schleppe") { + set req.backend_hint = motd-larry; + } + + if (req.http.host == "planetposen.schleppe") { + set req.backend_hint = planetposen; + } +} + +sub vcl_backend_response { + # Happens after we have read the response headers from the backend. + # + # Here you clean the response headers, removing silly Set-Cookie headers + # and other mistakes your backend does. + + + # Disable streaming; the body of a backend fetch may be delivered to clients + # as it is being delivered. + # + # beresp.do_stream = false +} + +sub vcl_deliver { + # Happens when we have all the pieces we need, and are about to send the + # response to the client. + # + # You can do accounting or modifying the final object here. +} +