views:

674

answers:

1

We have a reverse proxy here, running Apache in version 2.2.x Essentially I want to create a whitelist so that only valid URLs will go through the proxy and be processed by the web server. How do you do this in the Apache config file, or do you need to use SQUID?

+1  A: 

Create a text file with all of the valid urls and use it as a RewriteMap.

# /tmp/bar.txt:
# /blah.cgi good
# /bar.cgi bad

RewriteMap foo /foo/bar.txt

RewriteCond ${foo:%{REQUEST_URI}} ^good$
RewriteRule ^/(.*)$ proxy:http://foobackend/$1
Michael Cramer