Nginx в качестве UDP-балансировщика

После уста­нов­ки, отклю­ча­ем дефолт­ный конфиг

YAML$ cd /etc/nginx/conf.d/$ sudo mv default.conf default.conf.disable12$ cd /etc/nginx/conf.d/$ sudo mv default.conf default.conf.disable

Редак­ти­ру­ем основ­ной кон­фиг Nginx

YAML$ sudo nano /etc/nginx/nginx.conf…stream { upstream backends { server 192.168.1.10:5060; server 192.168.1.11:5060; } server { listen 5060 udp; proxy_pass backends; proxy_responses 1; }}events { worker_connections 1024;}…123456789101112131415161718$ sudo nano /etc/nginx/nginx.conf…stream {  upstream backends {    server 192.168.1.10:5060;    server 192.168.1.11:5060;  }  server {    listen 5060 udp;    proxy_pass backends;    proxy_responses 1;  }} events {    worker_connections  1024;}…

Про­ве­ря­ем кон­фиг на нали­чие ошибок

YAML$ sudo nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful123$ sudo nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful

Пере­за­пус­ка­ем Nginx

sudo systemctl restart nginx