Please take another look here. I've updated the option checking to use the scopes defined in rewrite_options.cc, along with supporting distinguishing between main (http) and server scopes.