Some improvements to kojipkgs vcl

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2017-04-05 21:49:10 +00:00
parent ee90934d26
commit 69c3e7174b

View file

@ -40,28 +40,11 @@ backend local-apache {
.threshold = 3; }
}
sub vcl_synth {
set resp.http.Content-Type = "text/html; charset=utf-8";
set resp.http.Retry-After = "5";
synthetic( {"<!DOCTYPE html>
<html>
<head>
<title>"} + resp.status + " " + resp.reason + {"</title>
</head>
<body>
<h1>Error "} + resp.status + " " + resp.reason + {"</h1>
<p>"} + resp.reason + {"</p>
<h3>Guru Meditation:</h3>
<p>XID: "} + req.xid + {"</p>
<hr>
<p>Varnish cache server on {{ inventory_hostname }}</p>
</body>
</html>
"} );
return (deliver);
}
sub vcl_recv {
set req.backend_hint = apache-local;
unset req.http.cookie;
set req.http.clear-cookies = "yes";
if (req.method == "PURGE") {
if (!client.ip ~ purge) {
return (synth(405, "Not allowed"));
@ -69,26 +52,17 @@ sub vcl_recv {
return(purge);
}
if (req.url ~ "^/repo/") {
if (client.ip ~ repoallowed) {
set req.backend_hint = apache-local;
unset req.http.cookie;
set req.http.clear-cookies = "yes";
}
else {
return(synth(403, "Access denied."));
}
if (req.url ~ "^/repo/" && !(client.ip ~ repoallowed)) {
return(synth(403, "Access denied."));
}
if (req.url ~ "^/mash/") {
set req.backend_hint = apache-local;
return (pipe);
}
if (req.url ~ "^/compose/") {
set req.backend_hint = apache-local;
return (pipe);
}
#
# deny the open264 rpms and such
# if (req.url ~ openh264)
#
if (req.url ~ "h264") {
return (pipe);
}
return (hash);
}