Skip to content

Nginx with RTMP

NGINX accelerates content and application delivery, improves security, facilitates availability and scalability for the busiest web sites on the Internet.

We will guide you through the configuration of your Nginx and RTMP server. After this tutorial, you will be fully compatible with Strive's Flink technology.

How to configure your NGINX and RTMP Module

Add the following to your nginx.conf. You will find your config at <installation-path>/conf.

# find location in server section
location / {
    # --- CORS beginn ---

    # CORS OPTIONS
    if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Allow-Headers' 'Range' always;
        add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS' always;
        add_header 'Content-Length' 0;
        return 204;
    }

    # CORS HEAD
    if ($request_method = 'HEAD') {
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length' always;
    }

    # CORS GET
    if ($request_method = 'GET') {
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length, Content-Range' always;
    }

    # --- CORS end ---
}

Next step

Continue with configuring your CDN.