Welcome! Log In Create A New Profile

Advanced

Re: upstream redirect instead proxy_pass

Maxim Dounin
May 18, 2015 11:06AM
Hello!

On Sun, May 17, 2015 at 01:07:30PM -0400, EvilMoe wrote:

> Hello,
>
> I would like to use Nginx as Load Balancer (traffic). My config is:
>
>
> upstream storages {
> least_conn;
> server str1 weight=1 max_fails=1 fail_timeout=10s;
> server str2 weight=1 max_fails=1 fail_timeout=10s;
> }
>
>
> server {
> listen 80;
> server_name verteilen;
> location / {
> proxy_pass http://storages;
> #return 302 $scheme://storages;
> }
> }
>
>
>
>
> How can I redirect to the server of upstream? With proxy_pass does it work
> but I want to move the traffic to several servers.
> I just need the "storages" variable.

The "upstream" directives defines servers for proxy - and things
like "least_conn" balancer in your config are not at all possible
unless nginx proxies connections.

If you want nginx to return redirects, you can use other
mechanisms available, like split_clients:

http://nginx.org/en/docs/http/ngx_http_split_clients_module.html

--
Maxim Dounin
http://nginx.org/

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

upstream redirect instead proxy_pass

EvilMoe May 17, 2015 01:07PM

Re: upstream redirect instead proxy_pass

Maxim Dounin May 18, 2015 11:06AM

Re: upstream redirect instead proxy_pass

EvilMoe May 19, 2015 12:31PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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