Using Coturn with other services that are reverse proxied?

I’m looking for a quick start on how to use caddy for reverse proxy while coturn is also running on the host. This is all done in a docker-compose. Coturn is generally run in docker host mode because it uses a lot of ports and large port ranges don’t work well in docker.

It’s not clear to me if the coturn traffic can just completely avoid caddy or if it would have to be proxied to the coturn container - and if so, is that a reasonable thing to do?

You’ll have to explain in more detail what your concerns are. I don’t use coturn, so I can only try to make assumption about what you mean.

Please fill out the help topic template, as per the forum rules.

I currently have an application stack on a VPS that are all being run from one domain (one domain is pointed to the IP). One app is running on common ports like 80 and 443. A few other apps use specific ports for their stuff. But I also have coturn running. It uses a bunch of ports as, well, that’s how it works. That particular docker container is set to use host network_mode. I want to put caddy in in front of the “regular” apps so that I can point some other domains to this IP and run other 443 apps but I’m pretty certain that the coturn traffic should not be proxied with caddy.

I think that the best approach is to use a different domain (or subdomain) for coturn and otherwise leave it in host mode. I am assuming that this will allow caddy to filter the other domains to where they need to go but the traffic for the coturn domain will just be “ignored” by caddy and instead will be grabbed at the host level. Or is it possible that caddy will ignore it anyway because of host mode??

Does this clarify it any?

I’m rather surprised that I don’t see more people running coturn on their VPSs.

“Please fill out the help topic template, as per the forum rules.”

Sorry about that but, I haven’t installed anything yet, This is a conceptual question. I’m trying to understand what Caddy does and determine a starting direction to attempt. Is there a different forum for these kinds of questions?

Caddy only uses ports 80 and 443, for HTTP and HTTPS respectively.

If Coturn doesn’t do HTTP protocol stuff, then there’s nothing to worry about, it’ll just work.

If Coturn has an HTTP interface though, then if you’re running Caddy in a container, you’ll need to proxy to your docker host IP.

For your other apps/containers, you can proxy to the container name + port.

I think that the best approach is to use a different domain (or subdomain) for coturn

Probably not necessary, a domain is just for DNS. Not (directly) related to ports.

I am assuming that this will allow caddy to filter the other domains to where they need to go but the traffic for the coturn domain will just be “ignored” by caddy and instead will be grabbed at the host level.

Yes, HTTP and HTTPS traffic is just on 80/443, and Caddy only binds to those ports (and port 2019 for its admin endpoint but that’s a small detail).

Ultimately, this sounds more like a docker networking question than a Caddy question.

:man_shrugging:

1 Like

Ah, I completely missed the memo that caddy only listens on 80/443. But that should be apparent because those are the only ports exposed with the host in docker anyway! Thanks for the help!

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.