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 ...
随机推荐
- 小情人emacs的自动补全
前天打字的时候发现手指疼-..OTL-思考了一下可能是我近几个月以来一直在使用全部手敲代码不使用自动补全的"恶果"(当然我还是建议全部手敲的,至少可以感觉到强烈的屌丝满足感). 先 ...
- CENTOS 7 开放端口设置
CentOS 7 默认没有使用iptables,所以通过编辑iptables的配置文件来开启80端口是不可以的 CentOS 7 采用了 firewalld 防火墙 如要查询是否开启80端口则: [r ...
- springframework hibernate Transaction not successfully started
先贴出错误:org.springframework.transaction.TransactionSystemException: Could not commit Hibernate transac ...
- Android 动画之RotateAnimation应用详解
android中提供了4中动画: AlphaAnimation 透明度动画效果 ScaleAnimation 缩放动画效果 TranslateAnimation 位移动画效果 RotateAnimat ...
- OfficePickers
OfficePickers http://www.codeproject.com/Articles/12327/Office-2003-Color-Picker 来自为知笔记(Wiz) 附件列 ...
- SQL Server 2012 sa 用户登录 18456 错误
近期想研究下SQL SERVER2012 Enterprise版本号的数据库,听说功能非常强大. 我是在win7上安装的,安装的过程非常顺利,我在用"Windows 身份验证"时, ...
- Java语言基础(二)
Java语言基础(二) 一.变量续 (1).变量有明确的类型 (2).变量必须有声明,初始化以后才能使用 (3).变量有作用域,离开作用域后自动回收 变量作用域在块内有效 (4).在同一定义域中变量不 ...
- 我的第一个C语言程序 (A+B Problem)(cheney-yang)
第一个接触的C语言程序,是一个简单的A+B问题! 题目出处:http://acm.nyist.net/JudgeOnline/problem.php?pid=1 题目描述: 计算a+b的值 输入: ...
- 汉诺塔-Hanoi
1. 问题来源: 汉诺塔(河内塔)问题是印度的一个古老的传说. 法国数学家爱德华·卢卡斯曾编写过一个印度的古老传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针.印度教的主神梵 ...
- <thead>
<thead> 标签定义表格表头该标签用于组合 HTML 表格表头内容 thead 元素应该与 tbody 和 tfoot 元素结合起来使用 tbody 元素用于对 HTML 表格主体内容 ...