Re: Nginx as LB to redirect/return to upstream server instead of Proxy
Am 15.10.2018 um 09:08 schrieb anish10dec:
> We want to use Nginx as LB in a way so that Nginx can return 301 or 302
> redirect to client instead of Proxying request to backend/upstream servers.
> It is required as Server which is configured as LB is having limited
> throughput of 1 Gbps while upstream servers are having throughput of 10Gbps
> We want users to directly connect to Upstream Server for Data delivery.
> Nginx LB Server to make sure that all upstream are up and functional before
> giving 301 or 302 redirect to any of upstream server
> http://nginxlb.com/data/download >
> Nginx LB Returns Redirected URL to Client 301 or 302 ( That upstream should
> be up)
> http://upstreamserver1.com/data/download > http://upstreamserver2.com/data/download >
> Is this possible by :
> return 301 http://$upstream_addr/data/download
I would do this with maps, rewrite and upstream variables.
Note thought that this won't do any checks on whether the upstream
server is up or not. If checks are needed, a better approach
might be to use some more sophisticated logic to return such
redirects. Most simple solution would be to actually proxy
requests to the upstream servers, and let these servers to return
actual redirects to themselves.