Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache ProxyPass - Regex to Exclude Files

I'm trying to exclude all files starting with "dgg-" and ending in ".xml", example: dgg-file-1.xml from using the apache proxy.

This works:

ProxyPass /myfile.xml ! # single file
ProxyPass /directory ! # all files inside dir

This doesn't work:

ProxyPass /dgg-(.*)\.xml !

How can I achieve this ?

ps- I'm using this code inside the httpd.conf->virtualhost not .htaccess.

like image 420
Pedro Lobito Avatar asked Jan 02 '12 13:01

Pedro Lobito


1 Answers

Use ProxyPassMatch. ProxyPass expects fully written path elements, it does not accept regexes.

As ProxyPassMatch takes a regex, this means you must also anchor it:

ProxyPassMatch ^/dgg-[^.]+\.xml$ !
like image 173
fge Avatar answered Nov 08 '22 17:11

fge