Welcome! Log In Create A New Profile

Advanced

302 Redirect only if node is UP !!

September 24, 2016 07:36AM
Hi,

Is there a way we can set NGINX to redirect only if Caching node is UP
otherwise serve from origin server ? Here is more details about the
scenario :

We've two servers (Origin & Cache) & here is the request scenario:

- client (1.1.1.1) requests a file to origin server
- Origin checks if ip is coming from specific ISP(in our case YES 1.1.1.1
belongs to ISP which we want to redirect to caching node for better latency)
- So Origin 302 redirect request to caching node.
- client served by caching node.

Now in case our ONLY single caching node goes down & nginx keeps on
redirecting client to caching node, that would be really bad. So we're
thinking if we could put a condition in NGINX to redirect only if caching
node is UP otherwise redirect should be ignored & request should be served
by Origin.

We know there's also another option which we can explore i.e upstream{} but
it'll proxy requests via Origin which we don't want, the only requirement
is 302 the client.


Need advise from experts here. Thanks in advance !!

Regards.
Shahzaib
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

302 Redirect only if node is UP !!

shahzaib1232 September 24, 2016 07:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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