Commit 5765f28e authored by Lasse Karstensen's avatar Lasse Karstensen

put the development server backend and override cookie stuff into a different files

parent 9eb24d3b
#
# devicedetect-dev.vcl
#
# Enable test URLs and cookie overrides
backend devicetest {
.host = "127.0.0.1";
.port = "8000";
}
sub vcl_recv {
if (req.url ~ "^/set_devicetype/") { error 701 regsub(req.url, "^/set_devicetype/", ""); }
if (req.url ~ "^/devicetest") { set backend = devicetest; }
}
sub vcl_error {
if (obj.status == 701 ) {
# obj.response == mobile-generic
set obj.http.Set-Cookie = "X-UA-device=" + obj.response;
set obj.http.Content-Type = "text/plain; charset=utf-8";
synthetic {" 200 OK, Cookie set "};
return(deliver)
}
}
"""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment