# Nginx reverse proxy with rtmp

**URL:** <https://www.ruby-forum.com/t/nginx-reverse-proxy-with-rtmp/244622>\
**Category:** NGINX\
**Created:** [May 14, 2016, 2:04am UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-with-rtmp/244622 "2016-05-14T02:04:39Z")\
**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:** [May 14, 2016, 2:04am UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-with-rtmp/244622/1 "2016-05-14T02:04:39Z")

</div>

I am trying to use nginx reverse proxy to connect to a nginx rtmp server

2 servers a and b

a = nginx with rtmp ( videos loacated here )

b = nginx reverse proxy

the reverse proxy is working good with http to stream my videos from  
server “a”

but i am not able to use it after installing rtmp on server “a”

this is my old server b config

server {  
listen 80;  
server\_name server\_a\_name;  
location / {  
proxy\_pass [http://ip](http://ip) of server a/;

```
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            access_log off;
            log_not_found off;

```

= }  
}

so after installing nginx rtmp on server a i have tried this config on  
server b

rtmp {  
server {  
listen 1935;  
application vod {

```
    pull rtmp://ip of server a:1935;

```

}  
}  
}  
also tried pull rtmp://ip of server a:1935/vod/;

and this is the config on server a

rtmp  
{  
server  
{  
listen 1935;  
notify\_method get;  
on\_play [http://127.0.0.1/vod\_handler](http://127.0.0.1/vod_handler);  
application vod  
{  
play /home/files/public\_html/cgi-bin/uploads/;  
}  
}  
}  
thanks

---

<div class="post-metadata">

**Author:** ![mzink](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mzink](https://www.ruby-forum.com/u/mzink)\
**Post date:** [May 14, 2016, 10:38am UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-with-rtmp/244622/2 "2016-05-14T10:38:44Z")

</div>

Rtmp it’s tcp and you need use nginx as tcp proxy like haproxy  
14 мая 2016 г. 3:04 пользователь “Zin Man” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
написал:

---

<div class="post-metadata">

**Author:** ![mzink](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mzink](https://www.ruby-forum.com/u/mzink)\
**Post date:** [May 14, 2016, 5:22pm UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-with-rtmp/244622/3 "2016-05-14T17:22:53Z")

</div>

Yuriy M. wrote in post #1183456:

> Rtmp it’s tcp and you need use nginx as tcp proxy like haproxy  
> 14 мая 2016 г. 3:04 пользователь “Zin Man” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> написал:

can you please give me an example config
