Marcus Clyne
July 26, 2009 09:30PM
Hi Merlin,

It appears you're trying to do :

HTTP > Nginx > Varnish > (back to Nginx as failsafe) > application.

Apart from the fact that try_files won't work with the config you
mentioned, I think you should probably be trying to use a different
application stack (or at least use them in a different way). One of the
below options are probably better:

HTTP > Varnish > application (Varnish has its own load-balancing
and failover for connections to backends)
HTTP > Varnish > Nginx (load-balancing) > application
HTTP > Varnish > HAProxy > application (HAProxy will typically
out-perform Nginx when all you need to do is to load-balance)
HTTP > HAProxy > Varnish [> HAProxy] > application (Very-high load and
failsafe - only need initial load-balancing with a very large number of
requests per second)
HTTP > Nginx (cache) > application (use the proxy cache feature in
Nginx, proxying to the application with a cache-miss)

If you have a normal load, then probably the first or the last of these
suggestions would probably be best for you. If you will have more than
a couple of application servers, then I would probably recommend the
last (i.e. using Nginx to cache, since I believe Nginx performs
load-balancing better than Varnish at this time, though you can do more
with VCL than you can with Nginx's conf files.

Hope this is useful,

Marcus.


>
>> merlin corey wrote:
>>
>>> Hello,
>>>
>>> Yes, very easily with 0.7.x and above. It would be something like
>>> below ( check http://wiki.nginx.org/NginxHttpCoreModule#try_files )
>>>
>>> location / {
>>> try_files @varnish @application;
>>> }
>>>
>>> location @varnish {
>>> // proxy to varnish
>>> }
>>>
>>> location @application {
>>> // proxy to application
>>> }
>>>
>>> -- Merlin
>>>
Subject Author Posted

Upstream fail over?

MortenP June 23, 2009 10:48AM

Re: Upstream fail over?

merlin corey June 26, 2009 05:33AM

Re: Upstream fail over?

Mitchua Mitchua July 26, 2009 10:42AM

Re: Upstream fail over?

Maxim Dounin July 26, 2009 04:56PM

Re: Upstream fail over?

Marcus Clyne July 26, 2009 09:30PM

Re: Upstream fail over?

Mahiti Support July 31, 2009 09:11AM

Re: Upstream fail over?

Maxim Dounin July 31, 2009 09:38AM

Re: Upstream fail over?

Mitchua Mitchua July 31, 2009 01:39PM

Re: Upstream fail over?

Mitchua Mitchua July 31, 2009 02:00PM

Re: Upstream fail over?

Maxim Dounin July 31, 2009 03:52PM

Re: Upstream fail over?

mitchua August 02, 2009 12:10PM

Re: Upstream fail over?

Igor Sysoev July 27, 2009 04:47AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 142
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