[Django]-PHP and Django: Nginx, FastCGI and Green Unicorn?

2πŸ‘

βœ…

I think one solution could be using a combination of PHP as apache module or through FastCGI and use mod_proxy apache module to do some reverse proxy to access your administration app running with gunicorn

You can have a setup like :

  • Front HTTP Server apache on port 80 : www.host.com:80
  • Backend HTTP Server gunicorn on another port : other.host.com:8080 or localhost:8080 publicly accessed with mod_proxy and url like www.host.com/admin/
  • Media HTTP Server : media.host.com, if it has to be on the same system you can use mod_proxy and run the NGINX server on another TCP port.

Note that you should not be able to get the best performance with the NGINX as a media server hidden behind apache with mod_proxy.

This part of setup relies upon the possibility of having more than one public IP adress on this slice.

πŸ‘€Benoit

1πŸ‘

I found this question and almost went down the path of using Green Unicorn myself. Just a note that uWSGI seems to give significantly better performance than Green Unicorn, see a set of benchmarks here.

Linode has a great howto for configuring uWSGI with Nginx on Ubuntu (it works fine on Debian too).

I’m now using this setup and very happy with it so far.

πŸ‘€Alex Dean

-1πŸ‘

For the PHP part consider to install any PHP accelerator like eAccelerator or any other bytecode cache.
This is a more general article but could also be interessting for you.
For the Django part I have no idea / experience.

πŸ‘€TheHippo

-1πŸ‘

I’ve been trying to run django behind nginx with WSGI module. It runs OK and pretty fast.
You’ll have to compile your own nginx, but it’s really painless.

πŸ‘€ArBaDaCarBa

Leave a comment