git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] mod_proxy_http rewrite problem


Thanks.

> If you accept that /frontpage path going up to the client/browser once
> the first / works, then you can:
>    ProxyPass / balancer://applicationcluster/frontpage/ ...
>    ProxyPass /frontpage/ balancer://applicationcluster/frontpage/ ...
>    ProxyPassReverse / balancer://applicationcluster/frontpage/
> The two ProxyPass handle the two kind of paths to forward (the
> longuest match should be elected first).

Using the two ProxyPass directives per above sends a request into a loop.  

access_log:

10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 -
10.24.3.10 - - [14/Jun/2018:15:31:30 -0700] "GET /frontpage/login.zul HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0" "F65A3883E2839AD76E9E0BFAA3E44F45.node3"


That includes removing the /frontpage from the BalancerMember declarations:

<Proxy balancer://applicationcluster>

                BalancerMember https://app1.example.com:8443 route=node1
                BalancerMember https://app2.example.com:8443 route=node2
                BalancerMember https://app3.example.com:8443 route=node3
                ProxySet lbmethod=bybusyness

</Proxy>

ProxyPreserveHost       On
ProxyPass / balancer://applicationcluster/frontpage/ stickysession=JSESSIONID
ProxyPass /frontpage/ balancer://applicationcluster/frontpage/ stickysession=JSESSIONID
ProxyPassReverse / balancer://applicationcluster/frontpage/ stickysession=JSESSIONID



Or if you want to masquerade /frontpage completetly, you could use
mod_proxy_html to rewrite response URLs on the fly.

The first option is probably simpler and it fits your needs, does it work?


Well, so far the only option that has been partially successful for me is to use a rewrite.  As mentioned, If I use:

RewriteEngine   On
RewriteRule "^/frontpage(.+)" "$1" [R,L]

^^^^
This allows for the login page to load successfully but subsequent requests fail.

Any thoughts on a URL rewrite(s) that might work?  I've played around with %{REQUEST_URI} and IS_SUBREQ but have had not success so far..

Any suggestions are very welcome..




( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache2-users/msg02744.html on line 94
Call Stack
#TimeMemoryFunctionLocation
10.0008376840{main}( ).../msg02744.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache2-users/msg02744.html on line 94
Call Stack
#TimeMemoryFunctionLocation
10.0008376840{main}( ).../msg02744.html:0