aboutsummaryrefslogtreecommitdiffstats
path: root/web/etc/varnish/nms.vcl
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-03-27 08:27:17 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-03-27 08:27:17 +0200
commit1d2470a411e5eaac7e5a1c5d5b6b81e92c92f4a8 (patch)
tree54b901757b088d54d33e70f28a6203383b4dc844 /web/etc/varnish/nms.vcl
parent0a230ac5481b9518abc64181dbbb4509d83c0b89 (diff)
parent96a9bb4c42f4b53020302fea2a46e734c61c0319 (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
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;
+ }
}