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. poj 1080 dp如同LCS问题

    题目链接:http://poj.org/problem?id=1080 #include<cstdio> #include<cstring> #include<algor ...

  2. springmvc报错 org.springframework.web.servlet.DispatcherServlet

    在写springMVC时,导入所有需要的包后,运行程序,控制台报以下错误: 严重: Servlet [springDispatcherServlet] in web application [/Spr ...

  3. Transact-SQL 常用函数 分类: SQL Server 2015-02-03 09:47 284人阅读 评论(0) 收藏

    (1)DECLARE 两种用法: 1>: DECLARE @usid VARCHAR(50),@usna NVARCHAR(100),@grna NVARCHAR(100); 2>: DE ...

  4. SQL 存储过程 通过多个ID更新数据 分类: SQL Server 2014-12-08 16:08 299人阅读 评论(0) 收藏

    下面举个例子说明: 我想让一部分品牌的名称(即Brand_Name)后面加上1,Brand_ID是主键,sql语句很容易实现,但是存储过程如何写呢? 错误写法如下: //*************** ...

  5. 关于Win8对getElementsByTagName等dom方法兼容性的替代方法

    在对Twebbrowser进行dom编程时,引用MSHTML并使用其中的HTMLDocument; IHTMLElementCollection;IHTMLElement;能获得较好的代码提示 其中封 ...

  6. vim 语法高亮

    1 .配置文件的位置 在文件夹 /etc/ 以下.有个名为vimrc 的文件.这是系统中公共的vim配置文件.对全部用户都有效.而在每一个用户的主文件夹下,都能够自己建立私有的配置文件,命名为:&qu ...

  7. [RxJS] Transformation operator: scan

    All of the combination operators take two or more observables as input. These operators may also be ...

  8. hadoop编程技巧(4)---总体情况key按类别搜索TotalOrderPartitioner

    Hadoop代码测试版:Hadoop2.4 原理:携带MR该程序随机抽样提取前的输入数据,样本分类,然后,MR该过程的中间Partition此值用于当样品排序分组数据.这使得可以实现全球排名的目的. ...

  9. Windows如何打包Qt程序

    很多Qt爱好者想发布自己的Qt软件,但却发现在其他没有安装Qt SDK的机器上无法运行,这就是本文想要说明的问题.现在网上大部分软件都要发布自己开发的应用程序,都会打包到exe文件中,待安装完exe文 ...

  10. 最近的两个小项目,2:Python webapp的docker镜像

    时间过得真快,一眨眼一个多月没更新了,但这一个月我可没偷懒啊,真的是忙.粘上两篇ReadMe勉强凑合一下,保持博客更新是好习惯. 基于Flask框架,uwsgi起服务,supervisor做管理,应该 ...