
CoTURN 앞에 Nginx UDP LoadBalancer를 추가하려고 합니다.
- VM에 ejabberd 설치
- VM에 nginx 설치
- VM에 설치된 턴
Nginx 구성:
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은 ejabberd와 함께 직접 사용할 때 잘 작동합니다. 필요한 모든 포트는 보안 정책에 열려 있습니다. 그러나 nginx는 데이터를 업스트림으로 전달하지 않습니다. 나는 공식 nginx 문서를 따랐습니다.
내가 뭘 잘못하고 있는지 잘 모르겠습니다.