0

I am trying to add a Nginx UDP LoadBalancer in front of CoTURN.

  • Installed ejabberd in a VM
  • Installed nginx in a VM
  • Installed coturn in a VM

Nginx config:

log_format    basic    '$remote_addr [$time_local] '
                       '$protocol $status $bytes_sent $bytes_received '
                       '$session_time';

# Enable access_log statements for debugging

access_log /var/log/nginx/stream.log basic buffer=32k;

upstream stream_cluster {
#    hash $remote_addr consistent;
    least_conn;
    server 30.40.50.60:3478;
    server 30.40.50.61:3478;
}

server {
    listen 3478 udp reuseport;
    listen 3478;
    #All UDP/TCP traffic will be forwarded to the cluster
    proxy_buffer_size 4096k;
    proxy_responses 0;
    proxy_bind $remote_addr transparent;
    proxy_protocol on;
    proxy_pass stream_cluster;
    allow all;
#    error_log /var/log/nginx/stream.log;
}

coturn is working nicely when directly used along with ejabberd. All required ports are open in the Security Policy. But nginx is not passing the data to the upstream. I have followed the official nginx documentation.

Not sure what I am doing wrong.

  • Don't use public IPv4 addresses, especially when they belong to the US military. Your traffic could be accidentally routed out to the real owner of the IP address instead of your internal networks. – Michael Hampton Sep 24 '21 at 00:41
  • These are just placeholder ipv4 addresses. We use private ipv4 in production. – Jubayer Arefin Sep 24 '21 at 04:38

0 Answers0