Proxy issue

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Proxy issue

Niranjan Rao
Greetings


Apache 2,4.29 on Ubuntu 18.04.

I had some trouble with proxy settings and struggled with it for two
days. Enabled trace5 level logging and finally got the source tarball
for my version and reasoned out the log entries to figure out the issue.
Now I am trying to understand whether my understanding of documentation
is wrong or documentation is confusing. Looking at the documentation at
https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass

I needed to have sticky session and had following as original config.
This worked as expected.

<Proxy "balancer://intercluster" >

        BalancerMember "ajp://someone:7573" route=app253
        BalancerMember "ajp://otherone:7573" route=app128
        ProxySet stickysession=JSESSIONID
</Proxy>

So I added growth parameter to proxy and all the hell broke loose.
Despite of sticky session each server was getting random requests. This
was even more confusing because log entries said it found correct route
but byrequest handler was picking worker with different route and even
setting BALANCER_ROUTE_CHANGED as it could be seen in the log file.

<Proxy "balancer://intercluster" growth=5>
        BalancerMember "ajp://someone:7573" route=app253
        BalancerMember "ajp://otherone:7573" route=app128
        ProxySet stickysession=JSESSIONID
</Proxy>

Ultimately right combination turned out to be. Seems like  once you
define growth param (could be only this one or gets affected by others),
ProxySet flag stopped working. I did reason it out based on logs and
looking at the method proxy_balancer_pre_request from
mod_proxy_balancer.c when worker will not be set.

<Proxy "balancer://intercluster" growth=5 stickysession=JSESSIONID >
        BalancerMember "ajp://someone:7573" route=app253
        BalancerMember "ajp://otherone:7573" route=app128
</Proxy>


Did I misunderstand document or does document need to be changed? Above
documentation link does have examples for ProxySet but it was not clear
to me behavior or routing changes based on how parameter is set.


Regards,


Niranjan


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]