Welcome! Log In Create A New Profile

Advanced

UDP Load balancing

January 28, 2020 08:52AM
Hi, I am testing nginx as a reverse proxy/load balancer for UDP. I have configured the upstream servers, and it is working fine, except one issue that is driving me crazy.

It seems that nginx does not keep the udp source ports between requests. It changes the source port on every request. So I can't use it to load balance udp protocols that needs several packets (for example, wireguard).

I am using version 1.14.0 on Ubuntu and this is my config file:

stream {
upstream udp_backend {
hash $remote_addr;
server 10.0.0.3:5180;
server 10.0.0.4:5180;
}
server {
listen 5180 udp;
proxy_pass udp_backend;
proxy_bind 10.0.0.2:5181;
}
}

Is there any parameter that allows me to preserve udp ports?
Thanks.
Subject Author Posted

UDP Load balancing

arigatox January 28, 2020 08:52AM

Re: UDP Load balancing

Roman Arutyunyan January 28, 2020 09:04AM

Re: UDP Load balancing

arigatox January 28, 2020 09:17AM

Re: UDP Load balancing - [Solved]

arigatox January 28, 2020 09:29AM

Re: UDP Load balancing - [Solved]

deprito April 21, 2020 09:22PM

Re: UDP Load balancing - [Solved]

Andrei April 23, 2020 08:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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