From 790464f576f6d776e32cc6d9973414e7841f006e Mon Sep 17 00:00:00 2001 From: deflax Date: Sun, 10 Oct 2021 22:27:33 +0000 Subject: [PATCH] provide mime.types --- rtmp/Dockerfile | 2 ++ rtmp/mime.types | 90 +++++++++++++++++++++++++++++++++++++++++++++++++ rtmp/nginx.conf | 25 +++++++++----- 3 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 rtmp/mime.types diff --git a/rtmp/Dockerfile b/rtmp/Dockerfile index 9c203bb..50bae21 100644 --- a/rtmp/Dockerfile +++ b/rtmp/Dockerfile @@ -1,6 +1,8 @@ FROM tiangolo/nginx-rtmp COPY nginx.conf /etc/nginx/nginx.conf +COPY mime.types /etc/nginx/mime.types + COPY index.html /www/ COPY network.m3u8 /www/ COPY network0.ts /www/ diff --git a/rtmp/mime.types b/rtmp/mime.types new file mode 100644 index 0000000..0abd048 --- /dev/null +++ b/rtmp/mime.types @@ -0,0 +1,90 @@ + +types { + text/html html htm shtml; + text/css css; + text/xml xml; + image/gif gif; + image/jpeg jpeg jpg; + application/javascript js; + application/atom+xml atom; + application/rss+xml rss; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/png png; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + image/svg+xml svg svgz; + image/webp webp; + + application/font-woff woff; + application/java-archive jar war ear; + application/json json; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.apple.mpegurl m3u8; + application/vnd.ms-excel xls; + application/vnd.ms-fontobject eot; + application/vnd.ms-powerpoint ppt; + application/vnd.wap.wmlc wmlc; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/x-7z-compressed 7z; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/xhtml+xml xhtml; + application/xspf+xml xspf; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; + application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/ogg ogg; + audio/x-m4a m4a; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mp2t ts; + video/mp4 mp4; + video/mpeg mpeg mpg; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-m4v m4v; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; +} + diff --git a/rtmp/nginx.conf b/rtmp/nginx.conf index bbb23c1..5af8658 100644 --- a/rtmp/nginx.conf +++ b/rtmp/nginx.conf @@ -1,4 +1,9 @@ -events {} +events { + worker_connections 1024; +} + +error_log /dev/stdout info; + http { sendfile off; # on|off. Toggles the use of sendfile. Default=off. For optimal HLS delivery disable this. tcp_nodelay on; # on|off. Forces a socket to send the data in its buffer, whatever the packet size. Default=on. @@ -10,6 +15,8 @@ http { server_names_hash_bucket_size 64; # Sets the bucket size for the server names hash tables depending on processor's cache line, 32|64|128. default_type application/octet-stream; # Emit this MIME type for all requests. + access_log /dev/stdout; + ## Include configuration files from these locations ## include /etc/nginx/mime.types; @@ -37,11 +44,16 @@ http { location /stats { rtmp_stat all; - rtmp_stat_stylesheet stat.xsl; + #rtmp_stat_stylesheet stat.xsl; #auth_basic Restricted Content; # Create a valid .htpasswd before uncommenting this. #auth_basic_user_file .htpasswd; # Create a valid .htpasswd before uncommenting this. } + location /admin { + proxy_pass http://frontend:5001; + include /etc/nginx/mime.types; + } + location /hls { types { application/vnd.apple.mpegurl m3u8; @@ -73,6 +85,7 @@ http { } rtmp { + access_log /dev/stdout; server { listen 1935; # Listen on standard RTMP port @@ -93,11 +106,9 @@ rtmp { ## Notifications use HTTP callback to inform subscribers that stream has started. You will need a website that can handle these. ## ## These option go beyond the scope of this configuration file as it contains lots of info. Please visit this url for more info: ## ## https://github.com/arut/nginx-rtmp-module/wiki/Directives#notify ## - - #publish_notify off; ## on|off. Send "NetStream.Play.PublishNotify" & "NetStream.Play.UnpublishNotify" to subscribers. Default=off - # on_publish http://www.example.com/plugin/Live/on_publish.php; + publish_notify on; ## on|off. Send "NetStream.Play.PublishNotify" & "NetStream.Play.UnpublishNotify" to subscribers. Default=off on_publish http://auth:8000/auth; - + notify_method get; # on_play http://www.example.com/plugin/Live/on_play.php; # on_record_done http://www.example.com/plugin/Live/on_record_done.php'; @@ -190,5 +201,3 @@ rtmp { } } - -