doujuxin7392 2016-04-28 18:19
浏览 187

mp4文件流与PHP通过nginx的“X-Accel-Redirect”无法在android上运行

The problem is quite simple. I'm trying to stream a file with php via via nginx's "X-Accel-Redirect" header, because it's less expensive to let nginx handle everything than streaming with php.

I'm using Chrome on both pc and Android to test.

Suppose that I have a file in the public root directory: example.com/video.mp4 This works just fine, both on pc and Android.

However, if I try to stream a file with the header "X-Accel-Redirect" (suppose that it's private, and it cannot be in the public directory), using this code:

header('Content-Type: video/mp4');
header('X-Accel-Redirect: /path/to/protected/directory/video.mp4');

It works on pc, but not on Android. The requests headers seems identical, and I honestly don't know what to search.

I've also checked the headers on both devices, they seem to be identical.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料