Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- listen [::]:80;
- server_name yourhostname;
- root /var/www/yourhostname;
- index index.php index.html index-nginx.html index.htm;
- add_header Strict-Transport-Security "max-age=63072000;";
- add_header X-Frame-Options "DENY";
- location / {
- add_header Cache-Control no-cache;
- add_header Access-Control-Allow-Origin *;
- try_files $uri $uri/ =404;
- }
- location ~ .php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
- # fastcgi_pass 127.0.0.1:9000;
- }
- location /stat {
- rtmp_stat all;
- rtmp_stat_stylesheet stat.xsl;
- #auth_basic Restricted Content;
- #auth_basic_user_file .htpasswd;
- }
- location /stat.xsl {
- root html;
- }
- location /control {
- rtmp_control all;
- #auth_basic stream;
- #auth_basic_user_file .htpasswd;
- }
- location ~ /.ht {
- deny all;
- }
- location /hls {
- types {
- application/vnd.apple.mpegurl m3u8;
- video/mp2t ts;
- }
- autoindex on;
- alias /var/livestream/hls;
- expires -1;
- add_header Strict-Transport-Security "max-age=63072000";
- add_header Cache-Control no-cache;
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length';
- 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;
- }
- }
- location /dash {
- types{
- application/dash+xml mpd;
- video/mp4 mp4;
- }
- autoindex on;
- alias /var/livestream/dash;
- add_header Strict-Transport-Security "max-age=63072000";
- add_header Cache-Control no-cache;
- expires -1;
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length';
- 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;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement