这是Veno File Manager 在Nginx下的伪静态规则。
Veno File Manager是一款不错的网盘应用,简单又轻量级,但官方似乎没有给出在Nginx环境下的伪静态规则,我尝试使用在线工具把其自带的Apache规则转为Nginx规则时出现了一系列莫名其妙的问题 比如:
nginx: [emerg] invalid condition "!-f"
nginx: [emerg] unknown "env_base" variable
nginx: configuration
- [ ] nginx: [emerg] directive "rewrite" is not terminated by ";"
。。。
通过观察后台URL规律,最终按照下列规则设置后程序完美运行:
location / {
if (!-e $request_filename){
rewrite download/(.*)/sh/(.*)$ /vfm-admin/vfm-downloader.php?q=$1&sh=$2 last;
}
rewrite download/(.*)/h/(.*)$ /vfm-admin/vfm-downloader.php?q=$1&h=$2 last;
rewrite download/zip/(.*)/n/(.*)$ /vfm-admin/vfm-downloader.php?zip=$1&n=$2 last;
}
转载原创文章请注明,转载自: LYLARES BLOG » Veno File Manager在Nginx环境下的伪静态规则