Simple config w/ planetposen & motd-larry backends

This commit is contained in:
2022-11-03 23:43:17 +01:00
parent bb0a4a0c7d
commit 387a3a57c1

48
default.vcl Normal file
View File

@@ -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.
}