Nginx as proxy and Apache with Load balancing

May 10, 2014 1.8k 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: http://www.nginxtips.com/how-to-configure-nginx-as-a-reverse-proxy-for-apache/#comment-31113 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!
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:

https://digitalocean.com/community/articles/how-to-configure-nginx-as-a-front-end-proxy-for-apache

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.
Have another answer? Share your knowledge.