1

I am trying to use webrtc inside of a difficult network that blocks all ports but 80 and 443 outbound and everything inbound. So I need a coturn server running to listen to 80 and 443 with SSL certs. I would like to run that alongside a REST API server, some websocket servers, and NGINX hosting static files. I am starting from this working nginx config. There is an example in another so question on how to forward on the root. But I wasn't able to get the same thing to work with a path. For example, I would like the turn server to work on <url>/coturn. I would prefer the ssl be handled by nginx but it is fine if that job gets passed to coturn.

Can anyone show me a nginx config that handles coturn with multiple other endpoints like this?

Edit: Here is a very minimal config, just trying to get the proxying to work similarly to this:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

stream{
    upstream turn_secure{
        server coturn:5349;
    }
    upstream turn{
        server coturn:3478;
    }

    server{
        listen 3478;
        proxy_pass turn;
    }
    server{
        listen 3478 udp;
        proxy_pass turn;
    }
    server{
        listen 5349;
        proxy_pass turn_secure;
    }
    server{
        listen 5349 udp;
        proxy_pass turn_secure;
    }
}

The domain references are given by the docker-compose that I have running.

But running this through trickleice, I get a non-reachable error. If I instead run coturn exposed to the internet then it seems to work as expected.

  • Did you get it working? I have a quite similar setup – Langohr Oct 30 '20 at 20:19
  • @Langohr I did not. Based on continued reading I ended up deciding that it just made more sense to have a dedicated VM for the coturn server. – Michael Sobrepera Nov 03 '20 at 23:33
  • This script, makes jitsi work with only 443: https://github.com/jitsi-contrib/installers/tree/main/jitsi-base. I couldnt manage to make it work with our proxy but it may work with yours – Sahin Jun 16 '21 at 16:53

0 Answers0