A Script Pro nginx URL重写规则无法播放MP4解决方法
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解决方法的更多相关文章
- 今天用pro安装nginx+php+mysql出现故障的解决方法
今天用pro安装nginx+php+mysql出现故障的解决方法 by 伍雪颖 dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1h ...
- Nginx 499错误的原因及解决方法
今天进行系统维护,发现了大量的499错误, 499错误 ngx_string(ngx_http_error_495_page), /* 495, https certificate error */n ...
- Nginx的500,502,504错误解决方法
Nginx的500,502,504错误解决方法 一.解决500错误: 1.500错误指的是服务器内部错误,也就是服务器遇到意外情况,而无法履行请求. 2.500错误一般有几种情况: (1)web脚本错 ...
- Nginx 504 Gateway Time-out分析及解决方法
一.场景还原php程序在执行抓取远程图片库并保存至本地服务器的时候,出现了“504 Gateway Time-out”错误提示. 问题定位:由于图片巨多,所以下载时间很长(10分钟以上),引起网关超时 ...
- Nginx常见错误与问题之解决方法技术指南
Nginx常见错误与问题之解决方法技术指南. 安装环境: 系统环境:redhat enterprise 6.5 64bit 1.Nginx 常见启动错误 有的时候初次安装nginx的时候会报这样的 ...
- nginx could not build the server_names_hash 解决方法
nginx “nginx could not build the server_names_hash”解决方法 给一个服务器下增加了一些站点别名,差不多有20多个. 重启nginx时候,提示: cou ...
- 格式工厂转化成mp4 avc格式 暴风影音不能播放的解决方法
格式工厂转化成mp4 avc格式 暴风影音不能播放的解决方法 先转成其他mp4 确保能播放 然后再转成avc
- ERROR:The requested URL could not be retrieved解决方法
ERROR 错误 The requested URL could not be retrieved 您所请求的网址(URL)无法获取 While trying to retrieve the URL: ...
- 腾讯云服务器php+mysq+nginx配置出现的问题及解决方法(亲测)
http://blog.csdn.net/hfdmv/article/details/50900043 删除文件命令 sudo rm -f /usr/share/nginx/html/home.php ...
随机推荐
- SRM 601(1-250pt,500pt)
DIV1 250pt 题意:有很多袋子,里面装有苹果和橘子(也可能没有),给出每个袋子里有多少个苹果,多少个橘子.如果每个袋子里含有水果的总数都不小于x个,则可以从每个袋子里都拿出x个水果(拿出苹果和 ...
- Live555 Streaming from a live source
https://www.mail-archive.com/live-devel@lists.live555.com/msg05506.html-----ask--------------------- ...
- 用code workshop取代code review
Box Tech Blog » Effective learning through code workshops介绍了Box如何用code workshop而不是code review的形式来改善代 ...
- 【设计模式 - 17】之中介者模式(Mediator)
1 模式简介 中介者模式的定义: 用一个中介者对象封装一系列的对象交互,中介者使各对象不需要显式地相互作用,从而使耦合松散,而且可以独立地改变它们之间的交互. 中介者模式中的组成部分: 1. ...
- PDO方法连接数据库(怕忘记,记起来)
PDO方法连接数据库更加安全! [完整代码,只需要添上对应的数据库即可以运行] <?php include "init.inc.php"; //--------------- ...
- 织梦CMS后台卡死的解决办法
[复制来于网上]原文地址:http://www.sjyhome.com/dedecms-6.html 改过一次第二次忘记怎么改,还是转一下,下次忘记了翻翻文章就可以知道了.好记忆不如烂笔头 一.原因分 ...
- 设计模式(4) -- 单例模式(Singleton)
设计模式(4) -- 单例模式(Singleton) 试想一个读取配置文件的需求,创建完读取类后通过New一个类的实例来读取配置文件的内容,在系统运行期间,系统中会存在很多个该类的实例对象,也就是说 ...
- 深入了解VSTS的Unit Test测试属性
深入的了解一下方法上带有的属性的含义.每个方法上几乎都带有TestMethod这个属性,我们直觉告诉我们,这肯定是表示被测试函数的意思.事实也正是如此,在Unit Test里,有许多测试属性,常用的如 ...
- UVA 10465 Homer Simpson(dp + 完全背包)
Problem C: Homer Simpson Time Limit: 3 seconds Memory Limit: 32 MB Homer Simpson, a very smart guy, ...
- LINUX 中的 TCP/IP协议 参数详解
Ipsysctl tutorial 1.0.4 Prev Chapter 3. IPv4 variable reference Next https://www.frozentux.net/ipsys ...