mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-01 22:11:01 +08:00
Show proxy name on varnish errors
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
- varnish
|
||||
|
||||
- name: install /etc/varnish/default.vcl
|
||||
copy: src={{ item }} dest=/etc/varnish/default.vcl
|
||||
owner=root group=root
|
||||
template: src=proxy.vcl dest=/etc/varnish/default.vcl
|
||||
owner=root group=root
|
||||
with_items:
|
||||
- proxy.vcl
|
||||
notify:
|
||||
|
||||
@@ -134,6 +134,27 @@ acl purge {
|
||||
"192.168.1.58"; //lockbox01.vpn
|
||||
}
|
||||
|
||||
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 {{ ansible_fqdn }}</p>
|
||||
</body>
|
||||
</html>
|
||||
"} );
|
||||
return (deliver);
|
||||
}
|
||||
|
||||
sub vcl_recv {
|
||||
if (req.method == "PURGE") {
|
||||
if (!client.ip ~ purge) {
|
||||
Reference in New Issue
Block a user