V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
ltzliwe
V2EX  ›  NGINX

我想把代理中的.mp4后缀的文件都缓存到nginx本地,然后使用mp4模块,但是缓存规则不起作用,我感觉我完全是按照文档来的。问题在于没有把获取到的文件存在本地,这是为什么。。

  •  
  •   ltzliwe ·
    lintianzhi · 2013-12-20 11:07:47 +08:00 · 4261 次点击
    这是一个创建于 3751 天前的主题,其中的信息可能已经有所发展或是发生改变。
    # http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_store

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_redirect off;

    location ~ \.mp4$ {
    mp4;
    root /data/www;
    error_page 404 = @fetch;
    }

    location @fetch {
    internal;

    proxy_pass http://backend;
    proxy_store on;
    proxy_store_access user:rw group:rw all:r;
    proxy_temp_path /data/temp;

    root /data/www;
    }
    1 条回复    1970-01-01 08:00:00 +08:00
    ltzliwe
        1
    ltzliwe  
    OP
       2013-12-20 11:44:26 +08:00
    丧心病狂。。
    原来的配置里面有 proxy_buffering off 这个选项! 关了就好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3365 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 00:05 · PVG 08:05 · LAX 17:05 · JFK 20:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.