Welcome! Log In Create A New Profile

Advanced

Nginx as Reverse Proxy Cache of fcgi django app in separate server

Alvaro Mantilla Gimenez
April 26, 2013 02:42PM
Hi,

I've been looking on Internet about this but seems all the examples
available are for a proxy conf or fcgi conf. Not both.

This is my scenario: I have three servers. The first one run only nginx
(and it should be the entry point for my websites) and the other two
servers run django apps.

Those django apps have been launched as fastcgi applications and listen
on some ports. For example:

/usr/bin/python /var/www/app/manage.py runfcgi method=threaded
host=server_ip port=1111

My intention is to run nginx as a reverse proxy for caching some pages
(created through django templates). I set the nginx configuration on this
way:

upstream app {
ip_hash;
server server_ip1:1111;
server server_ip2:1111;
}

location / {
include fastcgi_params;
fastcgi_pass app;
fastcgi_split_path_info ^()(.*)$;

}

This way the application works (however I am not sure if I am reaching
both servers). But, If I change the configuration to this:

location / {
proxy_pass http://app;
}

Then nginx shows an error and I can't see the django app.

Any idea?

Thanks in advance!!
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx as Reverse Proxy Cache of fcgi django app in separate server

Alvaro Mantilla Gimenez April 26, 2013 02:42PM

Re: Nginx as Reverse Proxy Cache of fcgi django app in separate server

Francis Daly April 27, 2013 05:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready