I have setup a fresh coTURN in linux ubuntu instance and hosted a domain with like turn.mydomain.com and configured the turnserver.conf and everything is seems to be fine on port 3478 and 5349 for TLS.
but in order to setup the TLS on 443 I have configured the nginx with my domain but the turn server is not working with 443 port.
turnserver.conf
realm=turn.mydomain.com
fingerprint
listening-ip=0.0.0.0
listening-port=3478
external-ip=PUBLIC_IP
min-port=32769
max-port=65535
log-file=/var/log/turnserver/turn.log
verbose
no-cli
no-loopback-peers
no-multicast-peers
#Long Term Credential Mechanism authentication
lt-cred-mech
user=myuser:mypassword
tls-listening-port=5349
cert=/etc/coturn/certs/fullchain.pem
pkey=/etc/coturn/certs/privkey.pem
turn.conf in /etc/nginx/modules-enabled
stream {
map $ssl_preread_server_name $name {
turn.mydomain.com turn_backend;
}
upstream turn_backend {
server PUBLIC_IP:5349;
}
server {
listen 443;
listen [::]:443; # since 1.11.5
ssl_preread on; proxy_pass $name; # Increase buffer to serve video
proxy_buffer_size 20m;
}
}
I have tried multiple methods but no luck.
Thanks in advance Sandeep J.