0

I have a server with root access.
The server hosts a java webapplication, servlet container Tomcat.
Nginx is a reverse proxy to Apache.
Apache is a reverse Proxy to Tomcat.
Single Tomcat node Apache proxy configuration is:

ProxyRequests Off
ProxyPass / http://127.0.0.1:5881/
ProxyPassReverse / http://127.0.0.1:5881/
ProxyPreserveHost On

And this works fine all requests are processed without error.

I have added an additional Tomcat node, port 5882 and can issue a http request to the servlet container node successfully, returns 200.

I altered the Apache configuration to:

<Proxy balancer://vcluster>
    BalancerMember http://127.0.0.1:5881/
    BalancerMember http://127.0.0.1:5882/
    ProxySet lbmethod=byrequests
</Proxy>

ProxyRequests Off
ProxyPass / balancer://vcluster/
ProxyPassReverse / balancer://vcluster/
ProxyPreserveHost On

Requests to Apache server now return 503 Gateway Error. Access log entry:

x.x.x.x - - [17/May/2018:14:12:51 +0000] "GET / HTTP/1.0" 503 871 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/5 (KHTML, like Gecko) Chrome/ Safari/"

No error in apache log.

Only requests on HTTPS allowed - HTTP redirects to HTTPS (redirect still works following configuration change). Tomcat is HTTP only, no HTTPS configured.

Apache, Nginx and all Tomcat nodes on same Ubuntu 16.04 Server.

All required apache2 modules installed and enabled: proxy_balancer proxy_http lbmethod_byrequests

Can you see any error in what I am doing that could cause this change to load balancing proxy to return 503 Gateway errors? Can you suggest another way of achieving the same thing?

Any help is greatly appreciated.

  • Hi, if the question is not about plesk directly, I suggest to remove that reference, as plesk question is offtopic on serverfault. – yagmoth555 May 17 '18 at 16:01
  • @yagmoth555 Thanks for the suggestion, removed the reference. – Dreggers May 17 '18 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.