diff --git a/contrib/configs/nginx/nntpchan.with-varnish b/contrib/configs/nginx/nntpchan.with-varnish index b93b2c6..cfa5838 100644 --- a/contrib/configs/nginx/nntpchan.with-varnish +++ b/contrib/configs/nginx/nntpchan.with-varnish @@ -71,7 +71,7 @@ server { alias $nntpchan/webroot/img/$1.$2; } - location ~ /thm/(.+)\.jpg$ { + location ~ /thm/(.+)$ { # http subdomain rewrite for sfw if ( $http_host ~ fbi ) { rewrite ^/(.+).jpg /static/placeholder.jpg break; @@ -79,7 +79,7 @@ server { if ( $http_host ~ sfw ) { rewrite ^/(.+).jpg /static/placeholder.jpg break; } - alias $nntpchan/webroot/thm/; + alias $nntpchan/webroot/thm/$1; } } diff --git a/contrib/configs/varnish/default.vcl b/contrib/configs/varnish/default.vcl index 7f16169..0ff47ab 100644 --- a/contrib/configs/varnish/default.vcl +++ b/contrib/configs/varnish/default.vcl @@ -41,10 +41,6 @@ sub vcl_recv { if (req.url ~ "\#") { set req.url = regsub(req.url, "\#.*$", ""); } - # Strip a trailing ? if it exists - if (req.url ~ "\?$") { - set req.url = regsub(req.url, "\?$", ""); - } return (hash); } @@ -66,7 +62,15 @@ sub vcl_backend_response { if (beresp.status == 500 || beresp.status == 502 || beresp.status == 503 || beresp.status == 504) { return (abandon); } - set beresp.ttl = 10s; + if (bereq.url == "/boards.html" ) { + set beresp.ttl = 60s; + } + if (bereq.url == "/index.html" ) { + set beresp.ttl = 60s; + } + if (bereq.url == "/" ) { + set beresp.ttl = 60s; + } set beresp.grace = 1h; return (deliver); }