provide mime.types

This commit is contained in:
deflax 2021-10-10 22:27:33 +00:00
parent b986163d9b
commit 790464f576
3 changed files with 109 additions and 8 deletions

View file

@ -1,6 +1,8 @@
FROM tiangolo/nginx-rtmp FROM tiangolo/nginx-rtmp
COPY nginx.conf /etc/nginx/nginx.conf COPY nginx.conf /etc/nginx/nginx.conf
COPY mime.types /etc/nginx/mime.types
COPY index.html /www/ COPY index.html /www/
COPY network.m3u8 /www/ COPY network.m3u8 /www/
COPY network0.ts /www/ COPY network0.ts /www/

90
rtmp/mime.types Normal file
View file

@ -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;
}

View file

@ -1,4 +1,9 @@
events {} events {
worker_connections 1024;
}
error_log /dev/stdout info;
http { http {
sendfile off; # on|off. Toggles the use of sendfile. Default=off. For optimal HLS delivery disable this. 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. 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. 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. default_type application/octet-stream; # Emit this MIME type for all requests.
access_log /dev/stdout;
## Include configuration files from these locations ## ## Include configuration files from these locations ##
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
@ -37,11 +44,16 @@ http {
location /stats { location /stats {
rtmp_stat all; 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 Restricted Content; # Create a valid .htpasswd before uncommenting this.
#auth_basic_user_file .htpasswd; # 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 { location /hls {
types { types {
application/vnd.apple.mpegurl m3u8; application/vnd.apple.mpegurl m3u8;
@ -73,6 +85,7 @@ http {
} }
rtmp { rtmp {
access_log /dev/stdout;
server { server {
listen 1935; # Listen on standard RTMP port 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. ## ## 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: ## ## 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 ## ## https://github.com/arut/nginx-rtmp-module/wiki/Directives#notify ##
publish_notify on; ## on|off. Send "NetStream.Play.PublishNotify" & "NetStream.Play.UnpublishNotify" to subscribers. Default=off
#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;
on_publish http://auth:8000/auth; on_publish http://auth:8000/auth;
notify_method get;
# on_play http://www.example.com/plugin/Live/on_play.php; # on_play http://www.example.com/plugin/Live/on_play.php;
# on_record_done http://www.example.com/plugin/Live/on_record_done.php'; # on_record_done http://www.example.com/plugin/Live/on_record_done.php';
@ -190,5 +201,3 @@ rtmp {
} }
} }