Welcome! Log In Create A New Profile

Advanced

Handling redirects among upstream servers

November 07, 2014 05:11AM
Hello,

I'm trying to configure Nginx to access a cluster of application servers using a simple proxy with multiple application servers in the upstream. The application servers use a REST api for object storage and retrieval, and use 301 redirects among the nodes of the cluster for load balancing. A client can connect to server A, then get a redirect to server B, where the request will be handled.

This fails when nginx is used as a proxy in this case:

- the client connects through the proxy and gets connected to server A

- A returns a 301 with one of the other servers in the Location header

- Nginx rewrites the location header, so information about which node the client is supposed to connect to is lost

Does Nginx offer a solution for this? Can nginx handle the 301 itself without the client ever knowing the redirect happend? Would it be possible to store the redirect into a client cookie which is read during the next request and forces nginx to connect to a particular upstream server?

Thank you,
Subject Author Posted

Handling redirects among upstream servers

zappa November 07, 2014 05:11AM

Re: Handling redirects among upstream servers

Maxim Dounin November 07, 2014 09:04AM

Re: Handling redirects among upstream servers

zappa November 07, 2014 12:25PM

Re: Handling redirects among upstream servers

zappa November 07, 2014 02:05PM

Re: Handling redirects among upstream servers

Maxim Dounin November 10, 2014 07:32AM

Re: Handling redirects among upstream servers

B.R. November 10, 2014 01:16PM

Re: Handling redirects among upstream servers

zappa November 11, 2014 03:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 61
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready