How-to use NGINX as an edge from a Wowza origin

If you are trying to setup a solution to be low cost and effective, you can look at combining Wowza as an origin and NGINX as an edge. Below I depict one way to set it all up. Here I assume you are new to NGINX but have a solid Wowza grounding. This very basic tutorial is demonstrating an install on a CentOS 6.5 x64 linux distribution.

1. Install NGINX/RTMP module

rpm –import
rpm -ivh
yum -y –enablerepo=atrpms install ffmpeg

Install some other pre-reqs since we will be compiling from source:

cd /root
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel git wget

Get the latest rtmp module via git:

git clone git://

Obtain the latest nginx version and extract:

mkdir -p src
cd src
tar -xzf nginx-1.5.7.tar.gz
cd nginx-1.5.7

Compile & install NGINX:

./configure –user=nginx –group=nginx –prefix=/etc/nginx –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –pid-path=/var/run/ –lock-path=/var/run/nginx.lock –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –with-http_gzip_static_module –with-http_stub_status_module –with-http_ssl_module –with-pcre –with-file-aio –with-http_realip_module –add-module=/root/nginx-rtmp-module/
make install
chmod +x /etc/init.d/nginx

Start your nginx service:

chkconfig nginx on
service nginx start

Note: You may need to add types_hash_bucket_size 64; to your /etc/nginx/nginx.conf file

Some other useful commands:

#reload nginx
nginx -s reload

service nginx restart

service nginx stop

service nginx start

#sometimes residual processes to not close properly, try the following
killall nginx

2. Setup Wowza

Simply setup a basic Wowza install and publish a stream to it.

3. Setup on-demand configuration

You will need to modify your nginx.conf to set this part up. Simply define the following:

application pullfromwowza {
  live on;
  pull rtmp://[your-wowza-ip]:1935/[app];

This should do a dynamic pull based on demand. Once this modification has been made, reload nginx (see above command). Then you can playback as follows:


This should do a dynamic pull based on demand. As a complete basic nginx.conf file, it would look something like:

worker_processes  1;
events {
    worker_connections  1024;
rtmp {
    server {
        listen 1935;
        application pullfromwowza {
           live on;
           pull rtmp://[your-wowza-ip]:1935/[app];

Note: This will only work via RTMP from nginx.

Comments are closed.