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. Redis学习记录之Java中的初步使用

    1.关于Redis redis下载地址:<span style="font-family: Arial, Helvetica, sans-serif;">http:// ...

  2. 【转】java 文件 读取目录下的所有文件(包括子目录)

    转自:http://www.cnblogs.com/pricks/archive/2009/11/11/1601044.html import java.io.File; import java.io ...

  3. 用python 装饰器打log

    # coding=utf-8    from time import time def logged(when):     def log(f,*args,**kargs):         prin ...

  4. UVa1572 UVaLive6393 Self-Assembly

    填坑系列(p.172) 注意“可以旋转和翻转” 然后将每个字母看成点 不然边数就是n^2级的 #include<cstdio> #include<cstring> #inclu ...

  5. Flash Stage3D 在2D UI 界面上显示3D模型问题完美解决

    一直以来很多Stage3D开发者都在为3D模型在2DUI上显示的问题头疼.Stage3D一直是在 Stage2D下面.为了做到3D模型在2DUI上显示通常大家有几种实现方式,下面来说说这几种实现方式吧 ...

  6. JAVA去掉字符串前面的0

    最佳方案:使用正则 String str = "000000001234034120"; String newStr = str.replaceAll("^(0+)&qu ...

  7. System.Data.DbType 与其它DbType的映射关系

    System.Data.DbType 与其它DbType的映射关系 有如下类型的映射对照: System.Data.SqlClient.SqlDbType System.Data.OleDb.OleD ...

  8. block没那么难(三):block和对象的内存管理

    本系列博文总结自<Pro Multithreading and Memory Management for iOS and OS X with ARC> 在上一篇文章中,我们讲了很多关于 ...

  9. cookingk配置项中的chunk:true含义

    学习cooking,查看中文文档,发现有个配置chunk: true, 不明白具体含义,于是根据注释,找到了相关代码, 即chunk: true等同于以下代码: var webpackConfig = ...

  10. STL的基本使用之关联容器:set和multiSet的基本使用

    STL的基本使用之关联容器:set和multiSet的基本使用 简介 set 和 multiSet 内部都是使用红黑树来实现,会自动将元素进行排序.两者不同在于set 不允许重复,而multiSet ...