I am using nginx and I have already add the line

    location /file/ {
rewrite ^/file/([-]+)/([-]+)/([^/]*)/([-]+)/(.*)$ /file.php?id=$&server=$&hash=$&expire=$&file=$ last;
}

in the conf file of the domain.

But the videos do not play.

I have try copy the parameters from the link to something like

http://www.mydomain.com/file.php?id=1&server=0&hash=796609733f08c4bb8b89&expire=1464380369&file=mp4/1.mp4

and I can see the mp4 file playing when I put the url directly on the browser.

Yet it will return 403 if I put the follow directly on the browser.

http://www.mydomain.com/file/1/0/796609733f08c4bb8b89/1464380369/mp4/1.mp4
 

So I suppose it is the problem of rewrite but I am not be able to figure out the causes.

How can I fix this problem?

OK, eventually I have figured it out.

we have to use

    location ^~ /file/ {
rewrite ^/file/([-]+)/([-]+)/([^/]*)/([-]+)/(.*)$ /file.php?id=$&server=$&hash=$&expire=$&file=$ last;
}

instead of

    location /file/ {...........}

otherwise it will keep searching for expressions and

location ~ \.mp4 {................}

which appears later will override the search for /file/, because apparently there will be a ".mp4" at the end of /file/ url.

I suggest symtab to change the instruction in the script zip file.

 http://forum.adultscriptpro.com/viewtopic.php?id=3627

A Script Pro nginx URL重写规则无法播放MP4解决方法的更多相关文章

  1. 今天用pro安装nginx+php+mysql出现故障的解决方法

    今天用pro安装nginx+php+mysql出现故障的解决方法 by 伍雪颖 dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1h ...

  2. Nginx 499错误的原因及解决方法

    今天进行系统维护,发现了大量的499错误, 499错误 ngx_string(ngx_http_error_495_page), /* 495, https certificate error */n ...

  3. Nginx的500,502,504错误解决方法

    Nginx的500,502,504错误解决方法 一.解决500错误: 1.500错误指的是服务器内部错误,也就是服务器遇到意外情况,而无法履行请求. 2.500错误一般有几种情况: (1)web脚本错 ...

  4. Nginx 504 Gateway Time-out分析及解决方法

    一.场景还原php程序在执行抓取远程图片库并保存至本地服务器的时候,出现了“504 Gateway Time-out”错误提示. 问题定位:由于图片巨多,所以下载时间很长(10分钟以上),引起网关超时 ...

  5. Nginx常见错误与问题之解决方法技术指南

      Nginx常见错误与问题之解决方法技术指南. 安装环境: 系统环境:redhat enterprise 6.5 64bit 1.Nginx 常见启动错误 有的时候初次安装nginx的时候会报这样的 ...

  6. nginx could not build the server_names_hash 解决方法

    nginx “nginx could not build the server_names_hash”解决方法 给一个服务器下增加了一些站点别名,差不多有20多个. 重启nginx时候,提示: cou ...

  7. 格式工厂转化成mp4 avc格式 暴风影音不能播放的解决方法

    格式工厂转化成mp4 avc格式 暴风影音不能播放的解决方法  先转成其他mp4 确保能播放 然后再转成avc

  8. ERROR:The requested URL could not be retrieved解决方法

    ERROR 错误 The requested URL could not be retrieved 您所请求的网址(URL)无法获取 While trying to retrieve the URL: ...

  9. 腾讯云服务器php+mysq+nginx配置出现的问题及解决方法(亲测)

    http://blog.csdn.net/hfdmv/article/details/50900043 删除文件命令 sudo rm -f /usr/share/nginx/html/home.php ...

随机推荐

  1. java 哈希码

    加入新的元素到数组中 /** * Append the given object to the given array, returning a new array * consisting of t ...

  2. struts2 最新S2-016-S2-017漏洞通杀struts2所有版本及修复方法

    详情查看http://zone.wooyun.org/content/5159 官方漏洞说明 http://struts.apache.org/release/2.3.x/docs/s2-016.ht ...

  3. 2014 ACM-ICPC Asia Anshan Regional Contest(Online Version)

    题目I - Osu! - HDU 5078 题目分析:最水的一道题吧,求两点间的距离和时间差值的最大比值 #include<stdio.h> #include<math.h> ...

  4. 如何设置win7系统的文件夹为系统文件,从而隐藏文件夹

    1.如图所示,通过去掉勾选“隐藏受保护的操作系统文件(推荐)”和勾选“显示隐藏的文件.文件夹和驱动器”,可以查看系统所有文件

  5. Mysql性能优化那些事

    ​    ​对于全栈而言,数据库技能不可或缺,关系型数据库或者nosql,内存型数据库或者偏磁盘存储的数据库,对象存储的数据库或者图数据库--林林总总,但是第一必备技能还应该是MySQL.从LAMP的 ...

  6. <WEB>平板_手机开发_13 个处理触摸事件和多点触摸的JS 库

    触摸屏是现在所有智能手机的标配,还包括各种平板设备,而且很多桌面也慢慢在开始支持触摸操作.要开发支持触摸屏设备的 Web 应用,我们需要借助浏览器的触摸事件来实线. 下图是各种触摸事件说明: 本文我们 ...

  7. gitlab一键安装

    参考 https://about.gitlab.com/downloads/

  8. 再回首,Java温故知新(十):数组

    数组是程序中用来存储同一类型值的集合,基本所有编程语言中都有这种类型存在.声明数组时需要指出数组类型和数组变量名,初始化后数组的长度不可变,使用过程中通过下标来访问数组中的元素,示例代码如下: int ...

  9. Java NIO——Selector机制源码分析---转

    一直不明白pipe是如何唤醒selector的,所以又去看了jdk的源码(openjdk下载),整理了如下: 以Java nio自带demo : OperationServer.java   Oper ...

  10. javascript动画效果

    之前工作项目中,运用了缓动动画的效果,在网上看到其他大牛写的相关公式,结合工作需要,进行了整理,拿出来跟大家分享下,js代码中,只运用了一个小功能进行了测试 <!DOCTYPE html> ...