Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Whitelist reverse proxy

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?

like image 501
alimack Avatar asked Aug 05 '26 17:08

alimack


1 Answers

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
like image 64
Michael Cramer Avatar answered Aug 08 '26 07:08

Michael Cramer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!