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.http.accept ~ "(^|,)image/avif($|,|;)") {
19 set req.http.accept = "image/avif,*/*";
21 set req.http.accept = "*/*";
23 if (req.method == "PUT") {
30 if (resp.http.x-varnish-host && resp.http.x-pr0n-purge) {
31 set resp.http.escaped-regex = regsuball(resp.http.x-pr0n-purge, "\\", "\\\\");
32 ban ( "obj.http.x-varnish-host == " + resp.http.x-varnish-host + " && obj.http.x-varnish-url ~ " + resp.http.escaped-regex );
33 unset resp.http.escaped-regex;
35 unset resp.http.x-varnish-host;
36 unset resp.http.x-varnish-url;
37 unset resp.http.x-pr0n-purge;
40 sub vcl_backend_response {
41 if (bereq.http.host ~ "^pr0n\.sesse\.net(:[0-9]+)?$") {
43 set beresp.http.x-varnish-host = bereq.http.host;
44 set beresp.http.x-varnish-url = bereq.url;
45 if (beresp.http.content-type ~ "^(text/html|text/plain|text/xml|text/css|application/x-javascript|application/javascript)") {
46 set beresp.do_gzip = true;
49 unset beresp.http.x-varnish-host;
53 To redeploy after changes:
55 sudo service pr0n reload && sudo varnishadm 'ban obj.http.x-varnish-host ~ "."'