Hi Yann, after reading your commit comment in https://svn.apache.org/r1898509 I realised that one important test case is missing: What happens if mod_rewrite manipulates the URL of a target that is proxied with the option mapping=servlet?
>From my point of view this test case fails. :-( ProxyPass /beta http://server2.localnet:8080/beta mapping=servlet RewirteRule "^/alpha/gobeta" /beta [PT,L] Calling https://example.org/alpha/gobeta/test sends back a 404 instead the beta content. In this case mod_proxy could not map the requests to the beta backend. more details in attachment: mod_rewrite_vs_proxy_pre_trans-v2_test_log2.txt regards, Hendrik
## test set up Server: httpd-2.4.52 with patch mod_rewrite_vs_proxy_pre_trans-v2.diff Hostname: example.org DocumentRoot: /var/www/example/docs ProxyPass /alpha http://server1.localnet:8080/alpha ProxyPass /beta http://server2.localnet:8080/beta mapping=servlet ProxyPass /gamma http://server3.localnet:8080/gamma RewriteRule "^/alpha/gobeta" /beta/ [PT,L] RewriteRule "^/alpha/gogamma" /gamma/ [PT,L] <Location /alpha> Require all granted </Location> <Location /beta> Require all granted </Location> <Location /gamma> Require all granted </Location> ## test case "rewrite to other backend" # (OK) calling https://example.com/alpha/gogamma/test sends back the gamma content [proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path '/alpha/gogamma/test' against prefix '/beta' for proxying [rewrite:trace2] mod_rewrite.c(480): .... init rewrite engine with requested uri /alpha/gogamma/test. Original filename = n/a [rewrite:trace3] mod_rewrite.c(480): .... applying pattern '^/alpha/gobeta' to uri '/alpha/gogamma/test' [rewrite:trace3] mod_rewrite.c(480): .... applying pattern '^/alpha/gogamma' to uri '/alpha/gogamma/test' [rewrite:trace2] mod_rewrite.c(480): .... rewrite '/alpha/gogamma/test' -> '/gamma/' [rewrite:trace2] mod_rewrite.c(480): .... forcing '/gamma/' to get passed through to next API URI-to-filename handler [proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path '/gamma/' against prefix '/alpha' for proxying [proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path '/gamma/' against prefix '/gamma' for proxying [proxy:trace1] mod_proxy.c(1000): AH03464: URI path '/gamma/' matches proxy handler 'proxy:http://server3.localnet:8080/gamma/' [authz_core:debug] mod_authz_core.c(818): AH01626: authorization result of Require all granted: granted [authz_core:debug] mod_authz_core.c(818): AH01626: authorization result of <RequireAny>: granted [proxy:trace2] proxy_util.c(2337): http: found worker http://server3.localnet:8080/gamma for http://server3.localnet:8080/gamma/ # (FAILED) calling https://example.com/alpha/gobeta/test sends back a 404 HTTP_NOT_FOUND [proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path '/alpha/gobeta/test' against prefix '/beta' for proxying [rewrite:trace2] mod_rewrite.c(480): .... init rewrite engine with requested uri /alpha/gobeta/test. Original filename = n/a [rewrite:trace3] mod_rewrite.c(480): .... applying pattern '^/alpha/gobeta' to uri '/alpha/gobeta/test' [rewrite:trace2] mod_rewrite.c(480): .... rewrite '/alpha/gobeta/test' -> '/beta/' [rewrite:trace2] mod_rewrite.c(480): .... forcing '/beta/' to get passed through to next API URI-to-filename handler [proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path '/beta/' against prefix '/alpha' for proxying [proxy:trace2] mod_proxy.c(884): AH03461: attempting to match URI path '/beta/' against prefix '/gamma' for proxying [authz_core:debug] mod_authz_core.c(818): AH01626: authorization result of Require all granted: granted [authz_core:debug] mod_authz_core.c(818): AH01626: authorization result of <RequireAny>: granted [core:info] AH00128: File does not exist: /var/www/example/docs/beta/
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
