I have the latest NGINX from ppa installed on Ubuntu 16.04.
nginx version: nginx/1.12.1
From my understanding, it should support stream and UDP load balancing.
But I get this error message:
nginx: [emerg] "stream" directive is not allowed here in /etc/nginx/conf.d/load-balancer.conf:3
This is my config in /etc/nginx/conf.d/load-balancer.conf
stream {
        upstream backend {
                least_conn;
                server 172.31.9.51 fail_timeout=10s;
                server 172.31.20.140 fail_timeout=10s;
        }
        server {
                listen          500 udp;
                listen          4500 udp;
                proxy_pass      backend;
                proxy_timeout   1s;
                proxy_responses 1;
                error_log       logs/dns.log;
        }
}