Skip to content

Instantly share code, notes, and snippets.

@marcw
Created January 17, 2012 20:43
Show Gist options
  • Save marcw/1628757 to your computer and use it in GitHub Desktop.
Save marcw/1628757 to your computer and use it in GitHub Desktop.
Varnish vcl file in order for varnish to participate to the sopa blackout
# use with:
#
# varnishadm -T host:port -S /etc/varnish/secret "vcl.load sopa /path/to/your/sopa.vcl"
# varnishadm -T host:port -S /etc/varnish/secret "vcl.use sopa"
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
error 503;
}
sub vcl_error {
set obj.http.Content-Type = "text/html; charset=utf-8";
synthetic {"
<html>
<head>
<title>Down during the SOPA Blackout</title>
</head>
<body>
<h1>Down during the SOPA Blackout.</h1>
</body>
</html>
"};
return (deliver);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment