Benefits of front-end vs. direct serving

What are the benefits of running Nginx as a front-end for Apache vs.
running PHP, Django, etc via FastCGI directly with Nginx?

Especially in terms of a VPS limited to 256MB - 512MB of RAM.

Sorry if this a very basic question that’s probably been asked before, I
did try searching but couldn’t find enough to go on.

I do not see any benefit in chaining Nginx and Apache like this
especially when you have a single server setup. The benefits will be
that you will have more help if you go with Apache, I mean more
resources online. For me Nginx is pretty much a drop in replacement
for Apache but without the overhead it Apache.

Kiril

It’s good to know then that my decision to not install Apache was not
wrong.

A few tutorials/articles for Django & Nginx I’ve seen appear to run
Nginx as a front-end server to Apache, which made me wonder if that was
indeed the way to go.

I don’t particularly miss Apache even though certain aspects of Nginx’s
config are harder to learn for a newbie like me.

Thanks and regards,
– Mihir

On Thu, 2008-04-03 at 05:30 +0200, Mihir Joshi wrote:

It’s good to know then that my decision to not install Apache was not
wrong.

A few tutorials/articles for Django & Nginx I’ve seen appear to run
Nginx as a front-end server to Apache, which made me wonder if that was
indeed the way to go.

There are several ways to run Django behind Nginx. You can run it as a
FastCGI or proxy to it using CherryPy’s wsgiserver. Probably you just
don’t know the right search terms:

http://wiki.dreamhost.com/index.php/Django
http://www.eflorenzano.com/blog/post/hosting-django-site-pure-python/

Regards,
Cliff

On Thu, Apr 03, 2008 at 01:33:15AM +0200, Mihir Joshi wrote:

What are the benefits of running Nginx as a front-end for Apache vs.
running PHP, Django, etc via FastCGI directly with Nginx?

Especially in terms of a VPS limited to 256MB - 512MB of RAM.

I can not say about Django, etc., but I think PHP is more controllable
inside Apache than as FastCGI server. However, you also may try to use
these
patches: http://php-fpm.anight.org

At my job we use Apache/mod_perl.

Thank you all for the links! I feel more confident with Nginx day by day
as I learn to use it more.

Igor S., thanks for making such a wonderful server, it’s really
amazing to see and use.

You are right that mod_python and mod_php make it easier to work with
Django & PHP respectively. I’ll give the FastCGI patches you linked a
shot before going the Nginx-Apache route. Either way I do appreciate the
benefits of having Nginx being the primary web-server.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs