Hi httpd users,

After adding the mapping=servlet option in the ProxyPass configuration, my
RewriteRule no longer works as desired.

Example:

   Hostname:  example.org
   ProxyPass  /alpha  http://server1.localnet:8080/alpha
   ProxyPass  /beta   http://server2.localnet:8080/beta  mapping=servlet
   RewriteRule ^/alpha - [F]
   RewriteRule ^/beta  - [F]

Calling https://example.org/alpha/anypath/ sends back a 403 Forbidden like
desired.
Calling https://example.org/beta/anypath/ sends back the beta content. The
RewriteRule does not catch the request.

I've increased the Logging
   LogLevel proxy:trace3
   LogLevel rewrite:trace3

Calling the alpha url I see this in my error.log:
[proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path
'/alpha/anypath/' against prefix '/beta' for proxying
[rewrite:trace2] mod_rewrite.c(480): .... init rewrite engine with
requested uri /alpha/anypath/
[rewrite:trace3] mod_rewrite.c(480): .... applying pattern '^/alpha' to uri
'/alpha/anypath/'
[rewrite:trace2] mod_rewrite.c(480): .... forcing responsecode 403 for
/alpha/anypath/

Calling the beta url I see this in my log:
[proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path
'/beta/anypath/' against prefix '/beta' for proxying
[proxy:trace1] mod_proxy.c(986): AH10248: Servlet path '/beta/anypath/'
(/beta/anypath/) matches proxy handler 'proxy:
http://server2.localnet:8080/beta/anypath/'
[rewrite:trace2] mod_rewrite.c(480): .... init rewrite engine with passed
filename proxy:http://server2.localnet:8080/beta/anypath/. Original uri =
/beta/anypath/
[rewrite:trace3] mod_rewrite.c(480): .... applying pattern '^/alpha' to uri
'proxy:http://server2.localnet:8080/beta/anypath/'
[rewrite:trace3] mod_rewrite.c(480): .... applying pattern '^/beta' to uri
'proxy:http://server2.localnet:8080/beta/anypath/'
[rewrite:trace1] mod_rewrite.c(480): .... pass through proxy:
http://server2.localnet:8080/beta/anypath/
[proxy_http:trace1] mod_proxy_http.c(98): HTTP: canonicalising URL
http://server2.localnet:8080/beta/anypath/
[proxy:trace2] proxy_util.c(2337): http: found worker
http://server2.localnet:8080/beta for
http://server2.localnet:8080/beta/anypath/

Is this a bug or do I have to use the "mapping=servlet" option very
carefully?

regards,
Hendrik

Reply via email to