Apache LocationMatch does not work for group

Posted by dma_k on Server Fault See other posts from Server Fault or by dma_k
Published on 2012-04-08T16:57:01Z Indexed on 2012/04/08 17:33 UTC
Read the original article Hit count: 172

Filed under:
|

I would like to configure Apache to proxy mldonkey running at localhost. Initially I have used the following configuration:

<IfModule mod_proxy.c>
    <LocationMatch /(mldonkey|bittorrent)/>
        ProxyPass           http://localhost:4080/
        ProxyPassReverse    http://localhost:4080/
    </LocationMatch>
</IfModule>

and it didn't worked! error.log reads [error] [client 192.168.1.1] File does not exist: /var/www/mldonkey which means that Apache does not intersect the URL.

However, when I change the regexp to following:

<LocationMatch /mldonkey/>

it started to work (i.e. mod_proxy functions OK, more over all ). I have tried the following alternatives:

<LocationMatch ^/(mldonkey|bittorrent)/>
<LocationMatch ^/(mldonkey|bittorrent)/.*>
<LocationMatch ^/(mldonkey|bittorrent)>
<LocationMatch /(mldonkey|bittorrent)>
<LocationMatch "^/(mldonkey|bittorrent)/">
<LocationMatch "/(mldonkey|bittorrent)">
<LocationMatch "/(mldonkey)">
<LocationMatch "/(mldonkey)/">

with no positive result. I am stuck. Please give me a hint where to look at.

P.S. Apache Server 2.2.19.

P.P.S. Would be happy if <LocationMatch> would work, without using the heavy artillery of mod_rewrite.

© Server Fault or respective owner

Related posts about apache2

Related posts about regex