Configure specific upstream node to spit 30x error

Hi all,

I was wondering if there is feasible way to have a node spit a specific
30x
error (i.e. 307) if it becomes unreachable, instead of passing to next
upstream node?

upstream mycluster {
server 192.168.1.2;
server 192.168.1.3;
server 192.168.1.4;
}

If node 192.168.1.3 is down, it should return a 307, instead of passing
to
192.168.1.4.

Thank you for your help.

Regards,

Floren

Posted at Nginx Forum:

Just to clarify, my goal is to make sure a php-fpm POST is passed to
next
node, if current fails. From my understanding the 307 error is designed
to
do this. Thank you.

Posted at Nginx Forum:

Hello!

On Wed, Aug 15, 2012 at 02:52:09PM -0400, TECK wrote:

}

If node 192.168.1.3 is down, it should return a 307, instead of passing to
192.168.1.4.

Something like this should work:

error_page 502 504 =307 http://example.com/;
proxy_next_upstream off;

See here for details:

http://nginx.org/r/error_page
http://nginx.org/r/proxy_next_upstream

Maxim D.

Thank you, Maxim. Related to second part of my question:
Will the POST be passed properly to next node, if first one fails? If is
not, is there a configuration setting that will enable that feature?

Regards,

Floren

Posted at Nginx Forum:

There will be a solution of,

Posted at Nginx Forum:

Hello!

On Wed, Aug 15, 2012 at 05:12:43PM -0400, TECK wrote:

Thank you, Maxim. Related to second part of my question:
Will the POST be passed properly to next node, if first one fails? If is
not, is there a configuration setting that will enable that feature?

Once you return 307 redirect to a client - it’s up to a client to
decide what to do.

If you want nginx to pass requests to a next upstream server, just
leave proxy_next_upstream as set by default to “error timeout”.
It works for all request methods.

See here for details:
http://nginx.org/r/proxy_next_upstream

Maxim D.