Welcome! Log In Create A New Profile

Advanced

Re: Retaining upstream server

June 20, 2018 03:32AM
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@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@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Retaining upstream server

nov1ce June 20, 2018 03:16AM

Re: Retaining upstream server

alexsamad June 20, 2018 03:32AM

Re: Retaining upstream server

nov1ce June 20, 2018 04:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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