Categories
Linux Mastering Development

NGINX RTMP not working with sites-enabled directory set

I’m having problems getting NGINX with the RTMP module to start when the RTMP server block is used within a file inside the sites-available (symbolic linked to sites-enabled). NGINX configuration files are all located at /etc/nginx/.

If I use the below RTMP server block directly in the nginx.conf, the server starts up perfectly fine. However, as soon I remove the comment from the line include /etc/nginx/sites-enabled/*; in the nginx.conf, systemctl status nginx.service comes back with"nginx: [emerg] "rtmp" directive is not allowed here in /etc/nginx/sites-enabled/livestream:1

rtmp {
    server {
        listen 1935;
        chunk_size;

        application obs_output {
            live on:
            record off;
        }
    }
}

These are the two guides I followed to install NGINX and the RTMP module.

Any ideas what’s going on here please?

Many thanks in advance

Leave a Reply

Your email address will not be published. Required fields are marked *