# WebRTC and NGINX Reverse Proxy

**URL:** <https://www.ruby-forum.com/t/webrtc-and-nginx-reverse-proxy/244883>\
**Category:** NGINX\
**Created:** [July 2, 2016, 6:22pm UTC](https://www.ruby-forum.com/t/webrtc-and-nginx-reverse-proxy/244883 "2016-07-02T18:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [July 2, 2016, 6:22pm UTC](https://www.ruby-forum.com/t/webrtc-and-nginx-reverse-proxy/244883/1 "2016-07-02T18:22:01Z")

</div>

Hi,

I have a PBX that has a webRTC feature (i.e. you login to PBX website  
and you have a virtual handset with all the features).

Is it feasible or possible to use NGINX as a reverse proxy to handle  
webRTC ?

A basic NGINX config just using proxy\_pass doesn’t seem to work, so I’m  
guessing there’s probably more to it than that ?

THanks !

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [July 4, 2016, 10:28am UTC](https://www.ruby-forum.com/t/webrtc-and-nginx-reverse-proxy/244883/2 "2016-07-04T10:28:07Z")

</div>

It works with something like this:

location ^~ /webrtc/ {  
if ($my\_https = “off”) {  
return 301 https://$host$request\_uri;  
}  
limit\_conn conn 100;  
limit\_req zone=basic burst=3000 nodelay;  
proxy\_pass [http://backend](http://backend);  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_read\_timeout 600s;  
proxy\_send\_timeout 600s;  
proxy\_connect\_timeout 20s;  
proxy\_http\_version 1.1;  
proxy\_set\_header Upgrade $http\_upgrade;  
proxy\_set\_header Connection upgrade;  
proxy\_set\_header Host $host;  
}

Best regards,  
Vintila Mihai Alexandru

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [July 4, 2016, 1:29pm UTC](https://www.ruby-forum.com/t/webrtc-and-nginx-reverse-proxy/244883/3 "2016-07-04T13:29:47Z")

</div>

Sounds fabulous. Thank Vintila !
