sintoniza/nginx-site-default.conf

56 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-05-06 22:32:09 +02:00
server {
listen 8080 default_server;
root /var/www/html/;
index index.html;
server_name _;
access_log off;
location / {
try_files $uri $uri/ =404;
}
location /control {
rtmp_control all;
}
# rtmp stat
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /var/www/html/rtmp;
}
2023-05-06 22:32:09 +02:00
location /canal {
# Disable cache
add_header Cache-Control no-cache;
# CORS setup
add_header 'Cache-Control' 'no-cache';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
add_header 'Access-Control-Allow-Headers' 'Range';
2023-05-06 22:32:09 +02:00
# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Range';
2023-05-06 22:32:09 +02:00
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;
}
}
}