url.rewrite does not work in $HTTP block lighttpd bug #2526

This commit is contained in:
Eric Warnke 2016-10-25 14:48:32 -04:00
parent 13f4fc3b25
commit 898f50d8a8

View file

@ -69,10 +69,11 @@ $HTTP["url"] =~ "^/admin/" {
setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!" ) setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!" )
} }
# Rewite js requests, must be out of $HTTP block due to bug #2526
url.rewrite = ( "^(?!/admin/).*\.js$" => "pihole/index.js" )
# If the URL does not start with /admin, then it is a query for an ad domain # If the URL does not start with /admin, then it is a query for an ad domain
$HTTP["url"] =~ "^(?!/admin)/.*" { $HTTP["url"] =~ "^(?!/admin)/.*" {
# Create a response header for debugging using curl -I # Create a response header for debugging using curl -I
setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )
# rewrite only js requests
url.rewrite = ("(.*).js" => "pihole/index.js")
} }