aboutsummaryrefslogtreecommitdiffstats
path: root/web/etc/varnish/nms.vcl
diff options
context:
space:
mode:
Diffstat (limited to 'web/etc/varnish/nms.vcl')
-rw-r--r--web/etc/varnish/nms.vcl11
1 files changed, 8 insertions, 3 deletions
diff --git a/web/etc/varnish/nms.vcl b/web/etc/varnish/nms.vcl
index 6349238..53a9444 100644
--- a/web/etc/varnish/nms.vcl
+++ b/web/etc/varnish/nms.vcl
@@ -11,6 +11,9 @@ backend default {
# Sort magi.
sub vcl_recv {
+ if (req.url ~ "^/where" || req.url ~ "^/location") {
+ set req.url = "/api/public/location";
+ }
if (req.method != "GET" &&
req.method != "HEAD" &&
req.method != "PUT" &&
@@ -22,9 +25,6 @@ sub vcl_recv {
return (synth(418,"LOLOLOL"));
}
- # Hardcoded for testing
- set req.http.host = "nms.tg16.gathering.org";
-
if (req.method != "GET" && req.method != "HEAD") {
/* We only deal with GET and HEAD by default */
return (pass);
@@ -37,6 +37,7 @@ sub vcl_recv {
return (hash);
}
+
# Rosa magi
sub vcl_hash {
# Wheee. Legg til authorization-headeren i hashen.
@@ -50,4 +51,8 @@ sub vcl_backend_response {
if (beresp.http.x-ban) {
ban("obj.http.x-url ~ " + beresp.http.x-ban);
}
+ if (beresp.status != 200) {
+ set beresp.uncacheable = false;
+ set beresp.ttl = 5s;
+ }
}