Retaining upstream server

Alex Samad alex at samad.com.au
Wed Jun 20 07:31:25 UTC 2018


Look at sticky session, a routing code in a cookie that helps you decide
where to send the packet. So on the 443 set the cookie and on the udp use
the cookie in the header to route on the back end



On 20 June 2018 at 17:16, nov1ce <nginx-forum at forum.nginx.org> wrote:

> Hello,
>
> 1.14.0-1 running on Debian Stretch:
>
> # dpkg -l | grep nginx
> ii  nginx                          1.14.0-1~stretch               amd64
>
>   high performance web server
>
> I'm trying to load balance between two VMware View Connection servers
> (10.7.18.121 and 10.7.18.122) listening on 443/tcp, 4172/tcp and 4172/udp.
> The way the application works is: first, the connecting client hits 443/tcp
> where authentication takes place, then the client gets connected to
> 4172/tcp
> (or 4172/udp).
>
> I have no problems when the connection is handled by the same upstream
> server, such as: remote_client > nginx_vip > 10.7.18.121:443 >
> 10.7.18.121:4172 or remote_client > nginx_vip > 10.7.18.122:443 >
> 10.7.18.122:4172. However, I get application errors if 443/tcp is handled
> by
> one server and 4172/tcp/udp by another.
>
> Therefore, I was wondering whether it'd be possible to configure Nginx in a
> such way that the upstream server is retained through the whole session? I
> mean, if a client gets served by 10.7.18.121:443 Nginx will use the same
> upstream to deliver 4172/tcp/udp?
>
> I can probably switch to active-backup model, but I was hoping to benefit
> from the load distribution.
>
> Many thanks.
>
> stream {
>
>    log_format  basic   '$time_iso8601 $remote_addr '
>                         '$protocol $status $bytes_sent $bytes_received '
>                         '$session_time $upstream_addr '
>                         '"$upstream_bytes_sent" "$upstream_bytes_received"
> "$upstream_connect_time"';
>    access_log  /var/log/nginx/stream_access.log basic;
>
>    upstream test_horizon_4172_tcp {
>       hash $remote_addr consistent;
>       server 10.7.18.121:4172;
>       server 10.7.18.122:4172;
>     }
>
>    upstream test_horizon_4172_udp {
>       hash $remote_addr consistent;
>       server 10.7.18.121:4172;
>       server 10.7.18.122:4172;
>     }
>
>    upstream test_horizon_https {
>       hash $remote_addr consistent;
>       server 10.7.18.121:443;
>       server 10.7.18.122:443;
>     }
>
>    server {
>       listen 4172;
>       proxy_pass test_horizon_4172_tcp;
>    }
>
>    server {
>       listen 4172 udp;
>       proxy_pass test_horizon_4172_udp;
>    }
>
>    server {
>       listen 443;
>       proxy_pass test_horizon_https;
>    }
>
> }
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?2,280183,280183#msg-280183
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180620/42d7db62/attachment.html>


More information about the nginx mailing list