Nginx文件服务器/媒体服​​务器/有时会出现错误404

时间:2018-08-31 07:36:20

标签: nginx fileserver

我正在使用Nginx作为文件服务器/提供* .mpd / * .mp4文件的媒体服务器。服务器随机给出错误404(找不到文件),但是磁盘上存在文件。

这是我的nginx配置:

server {

    listen              443 ssl http2 backlog=8192;
    listen              [::]:443 ssl http2;
    keepalive_timeout   70;
add_header Access-Control-Allow-Origin *; 
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
    ssl_prefer_server_ciphers on;
    ssl_certificate     <my_certfificate>;
    ssl_certificate_key <my_certificate_key>;
    ssl_stapling        on;
    ssl_stapling_verify off;
    ssl_dhparam         <my_dhparam>;
    ssl_session_cache   shared:SSL:10m;
    ssl_session_timeout 10m;
    server_name example.com;
    client_max_body_size 1024M;

    location / {
    alias /data/media/;
    sendfile on;
    sendfile_max_chunk 2m;
    tcp_nopush on;
    tcp_nodelay       on;
    keepalive_timeout 65;
    autoindex on;


 }

    location ^~ /.well-known/acme-challenge/ {
    default_type "text/plain";
    root /etc/letsencrypt;
    }
 }

我使用autoindex off和以下选项进行了尝试,但结果仍然相同:

    location / {
    mp4;
    mp4_buffer_size 4M;
    mp4_max_buffer_size 10M;
    open_file_cache off;
    alias /data/media/;
    autoindex on;
    }

MPD和MP4文件由Shaka Packager制作(直播电视)。我发现重启Nginx很有帮助,但这并不是一个很好的解决方案,因为正如我所说,这是直播电视。请问有人有类似的经历吗,还是有人知道如何解决?

谢谢!

0 个答案:

没有答案