tiny-livestream/nginx.conf

115 lines
3.1 KiB
Nginx Configuration File

daemon off;
error_log /dev/stderr;
events {
worker_connections 1024;
}
rtmp {
access_log /dev/stdout combined;
server {
listen 1935;
live on;
include /streamer_configs/*.conf;
}
}
http {
#include mime.types; # missing in my container for some reason.
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
}
access_log /dev/stdout combined;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
server {
root /www;
listen 80;
# Uncomment these lines to enable SSL.
# Update the ssl paths with your own certificate and private key.
# listen 443 ssl;
# ssl_certificate /opt/certs/example.com.crt;
# ssl_certificate_key /opt/certs/example.com.key;
location /hls {
root /www;
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
if ($request_method = OPTIONS) {
return 200;
}
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet static/stat.xsl;
}
location / {
root /www/static;
}
location = /crossdomain.xml {
root /www/static;
default_type text/xml;
expires 24h;
}
# begin XMPP
# location /xmpp/bosh {
# proxy_pass http://xmpp:24714/http-bind;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_buffering off;
# tcp_nodelay on;
# }
# location /xmpp/websocket {
# proxy_pass http://xmpp:24714/xmpp-websocket;
# proxy_http_version 1.1;
# proxy_set_header Connection "Upgrade";
# proxy_set_header Upgrade $http_upgrade;
# proxy_read_timeout 900s;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_buffering off;
# tcp_nodelay on;
# }
# end XMPP
# streamers
location ~ ^/(STREAMER1|STREAMER2|STREAMER3)$ {
default_type text/html;
alias /www/static/both.html;
}
location ~ ^/(STREAMER1|STREAMER2|STREAMER3)/chat$ {
default_type text/html;
alias /www/static/chat.html;
}
location ~ ^/(STREAMER1|STREAMER2|STREAMER3)/stream$ {
default_type text/html;
alias /www/static/stream.html;
}
}
}