1 pr0n is copyright Steinar H. Gunderson <sgunderson@bigfoot.com>. Everything
2 (that includes the Perl code, the configuration snippets, the database schema,
3 the CSS, the templates, any HTML or JavaScript and any documentation, but _not_
4 any of the images on pr0n.sesse.net etc.) is licensed under the GNU General
5 Public License, version 2. For the full license text, see the COPYING file.
7 Documentation? Forget it; if you can't set it up, use something else. You can
8 have a typical Varnish snippet, though:
16 if (req.http.host ~ "^pr0n\.sesse\.net(:[0-9]+)?$") {
17 set req.backend_hint = pr0n;
18 if (req.method == "PUT") {
25 if (resp.http.x-varnish-host && resp.http.x-pr0n-purge) {
26 set resp.http.escaped-regex = regsuball(resp.http.x-pr0n-purge, "\\", "\\\\");
27 ban ( "obj.http.x-varnish-host == " + resp.http.x-varnish-host + " && obj.http.x-varnish-url ~ " + resp.http.escaped-regex );
28 unset resp.http.escaped-regex;
30 unset resp.http.x-varnish-host;
31 unset resp.http.x-varnish-url;
32 unset resp.http.x-pr0n-purge;
35 sub vcl_backend_response {
36 if (bereq.http.host ~ "^pr0n\.sesse\.net(:[0-9]+)?$") {
38 set beresp.http.x-varnish-host = bereq.http.host;
39 set beresp.http.x-varnish-url = bereq.url;
40 if (beresp.http.content-type ~ "^(text/html|text/plain|text/xml|text/css|application/x-javascript|application/javascript)") {
41 set beresp.do_gzip = true;
44 unset beresp.http.x-varnish-host;
48 To redeploy after changes:
50 sudo service pr0n reload && sudo varnishadm 'ban obj.http.x-varnish-host ~ "."'