nginx hashing outgoing stream name

时间:2019-04-16 22:19:17

标签: ubuntu nginx hls

Hello I am trying to figure out how to rename my stream in nginx as it is going out what I would like to be able to do is take for instance QMUTYbVy9OYX3i7xHhC58gjlZu8ZnweB.m3u8 and hash it with md5 into 095ae749f9f45bdf190688f7a851b031.m3u8

here is my nginx.conf

#user  nobody;
worker_processes  1;
error_log  logs/rtmp_error.log debug;
pid        logs/nginx.pid;
events {
    worker_connections  1024;
}
http {
    server {
        listen       80;
        server_name  localhost;
        location /hls {
            # Serve HLS fragments
            # CORS setup
            add_header 'Access-Control-Allow-Origin' '*' always;
            add_header 'Access-Control-Expose-Headers' 'Content-Length';
            # allow CORS preflight requests
            if ($request_method = 'OPTIONS') {
                add_header 'Access-Control-Allow-Origin' '*';
                add_header 'Access-Control-Max-Age' 1728000;
                add_header 'Content-Type' 'text/plain charset=UTF-8';
                add_header 'Content-Length' 0;
                return 204;
            }
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
            root /tmp;
            add_header Cache-Control no-cache;
        }
    }
}
rtmp {
        server {
                listen 1935;
                chunk_size 8192;
                application hls {
                        live on;
                        meta copy;
                        hls on;
                        hls_path /tmp/hls;
        }
    }
}

I have heard that maybe ngx_http_secure_link_module could do this however all of the tutorials I have found are for renaming the path to the file and not the file name itself.

Thank you in advance for any help as it is greatly appreciated.

0 个答案:

没有答案