Nginx as proxy and Apache with Load balancing

Posted May 10, 2014 4.2k views
Hello! I've three doplets, one as a Load Balancer and the other two as webservers. Load Balancer is working fine, and the webservers too at the first time. But when I've added Apache to use Nginx as a reverse proxy, to get the most of the webservers, LB with webservers still is working but when I go to: http://LoadbalancerIP/test.php I can see that Apache isn't working with PHP. I've configured reading this: and other guides from you, but still isn't working. I can guess that the problem is in rpaf.conf, in which I put the IP from Load Balancer. RPAFproxy_ips LoadBalancerIP But still isn't working, can you help me? Thanks in advance!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
Hi Pablo!

Could you clarify what your setup is? What is on each server? Is Nginx in front of Apache on all three, including the load balancer?

To use Nginx as a proxy for Apache on the web servers, check out this guide:

As for the load balancer, I think you would be better off pick one or the other. Using Nginx as a proxy in front of Apache, which then proxies to one of your web servers add too many steps, in my opinion.