# OpenVidu behind existing nginx-proxy on the same host

**URL:** https://openvidu.discourse.group/t/openvidu-behind-existing-nginx-proxy-on-the-same-host/2934
**Category:** How to implement?
**Tags:** v2
**Created:** [April 13, 2021, 6:03pm UTC](https://openvidu.discourse.group/t/openvidu-behind-existing-nginx-proxy-on-the-same-host/2934 "2021-04-13T18:03:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zubrdev](https://avatars.discourse-cdn.com/v4/letter/z/8797f3/32.png) [@zubrdev](https://openvidu.discourse.group/u/zubrdev)
#### Post date: [April 13, 2021, 6:03pm UTC](https://openvidu.discourse.group/t/openvidu-behind-existing-nginx-proxy-on-the-same-host/2934/1 "2021-04-13T18:03:44Z")

</div>

Hi there!  
I’m trying to deploy dockerized openvidu server onto existing set of other containers. Setup based on openvidu/openvidu-server & kurento/kurento-media-server images only is in my docker-compose file.

Every single tutorial i’ve checked so far instructs to use nginx (namely openvidu/openvidu-proxy) as a gateway before all the other components coordinated by openvidu. But I don’t have a need for that, because I have already one – jwilder/nginx-proxy – which does an awesome job of automated reverse proxy configs for every new container added. Current setup is such that every service is tight with another by means of common default network created by docker. In conjunction with jrcs/letsencrypt-nginx-proxy-companion image based container the job for obtaining certificates for all the virtual host I have in my stack of containers is done in automatted manner.  
So I just would like to integrate openvidu stack in the same way that other services around all together on the same host machine.  
Is it possible not using “network\_mode: host” for openvidu related services but rather take the common default docker network?  
If so what is the most appropriate architecture I should implement?

---

<div class="post-metadata">

### Author: ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)
#### Post date: [April 14, 2021, 3:14pm UTC](https://openvidu.discourse.group/t/openvidu-behind-existing-nginx-proxy-on-the-same-host/2934/2 "2021-04-14T15:14:39Z")

</div>

I know very well `jwilder/nginx-proxy`, but it is nice when you have containers which only bind two or three ports, but i don’t think this image will fit the use case of openvidu. OpenVidu needs network host because it needs a lot ports to work properly.

When you bind port ranges in Docker, launch time and performance are really slow because of Docker updating ip tables to bind ports into the host network. That’s why OpenVidu needs `network_mode: host` to work properly.

If you need to modify the nginx configuration of OpenVidu, take a look to this:  
[https://docs.openvidu.io/en/2.17.0/troubleshooting/#16-how-can-i-customize-deployed-nginx](https://docs.openvidu.io/en/2.17.0/troubleshooting/#16-how-can-i-customize-deployed-nginx)

Regards.

---

<div class="post-metadata">

### Author: ![zubrdev](https://avatars.discourse-cdn.com/v4/letter/z/8797f3/32.png) [@zubrdev](https://openvidu.discourse.group/u/zubrdev)
#### Post date: [April 14, 2021, 7:05pm UTC](https://openvidu.discourse.group/t/openvidu-behind-existing-nginx-proxy-on-the-same-host/2934/3 "2021-04-14T19:05:27Z")

</div>

Yeah. I’ve already experienced such the situation while trying to bind “just” a hundred of ports. Docker actually hung right away. Haha. So you have confirmed my tendency to deploy openvidu into separate dedicated server. Thanks!

---

<div class="post-metadata">

### Author: ![cindyforcia](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cindyforcia/32/1444_2.png) [@cindyforcia](https://openvidu.discourse.group/u/cindyforcia)
#### Post date: [April 19, 2021, 11:31am UTC](https://openvidu.discourse.group/t/openvidu-behind-existing-nginx-proxy-on-the-same-host/2934/4 "2021-04-19T11:31:49Z")

</div>

@zubrdev I have read these tutorial many times. so nice of you for sharing this wonderful info with us. I will try this as well as you mentioned.
