Welcome! Log In Create A New Profile

Advanced

Upstream setup with proxy and fastcgi?

April 14, 2011 02:15PM
Hi,

I plan to do a basic load balancer setup and want to understand the differences between fastcgi_pass and proxy_pass.

upstream proxy {
server 1.localserverip:8000;
server 2.localserverip:8000;
server 3.localserverip:8000;
server 4.localserverip:8000;
}

upstream php {
server 1.localserverip:9000;
server 2.localserverip:9000;
server 3.localserverip:9000;
server 4.localserverip:9000;
}

server {
listen publicserverip:80;
server_name example.com;
root /var/www/html;
index index.php index.html;

location / {
proxy_pass http://proxy;
try_files $uri $uri/ /index.php;
}

location ~ \.php$ {
fastcgi_pass php;
include fastcgi.conf;
}
}

My goal is to have 2 servers as load balancers (1.localserverip and 5.localserverip set with heartbeat) and redirect the traffic through all nodes using Nginx. The site content will be identical in all servers. Can you let me know if using fastcgi_pass will do the same thing as proxy_pass, or do I have to set everything up like in the above configuration? I will serve static and php files through the backend. Following the logic it might require that I set both fastcgi_pass and proxy_pass into config. Could you give me a quick example so I understand how everything works?

Thanks
Subject Author Posted

Upstream setup with proxy and fastcgi?

TECK April 14, 2011 02:15PM

Re: Upstream setup with proxy and fastcgi?

TECK April 16, 2011 06:49PM

Re: Upstream setup with proxy and fastcgi?

Igor Sysoev April 18, 2011 10:12AM

Re: Upstream setup with proxy and fastcgi?

TECK April 18, 2011 11:13AM

Re: Upstream setup with proxy and fastcgi?

TECK April 18, 2011 12:29PM

Re: Upstream setup with proxy and fastcgi?

Francis Daly April 18, 2011 01:08PM

Re: Upstream setup with proxy and fastcgi?

TECK April 18, 2011 01:45PM

Re: Upstream setup with proxy and fastcgi?

TECK April 18, 2011 02:25PM

Re: Upstream setup with proxy and fastcgi?

Igor Sysoev April 18, 2011 02:02PM

Re: Upstream setup with proxy and fastcgi?

TECK April 18, 2011 02:45PM

Re: Upstream setup with proxy and fastcgi?

Francis Daly April 18, 2011 03:04PM

Re: Upstream setup with proxy and fastcgi?

Igor Sysoev April 18, 2011 02:30PM

Re: Upstream setup with proxy and fastcgi?

Francis Daly April 18, 2011 02:36PM

Re: Upstream setup with proxy and fastcgi?

TECK April 18, 2011 03:11PM

Re: Upstream setup with proxy and fastcgi?

TECK April 22, 2011 05:02AM

Re: Upstream setup with proxy and fastcgi?

Francis Daly April 23, 2011 06:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 65
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready