求助一个文件转换为nginx
# Turn on URL rewritingRewriteEngine On
# Installation directory
RewriteBase /plugins/support
# Protect hidden files from being viewed
Order Deny,Allow
Deny From All
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0
谁知道怎么转换?
本帖最后由 dabiantai 于 2016-12-14 06:16 编辑
set $install_dir /plugins/support;
location~ \.* {
deny all;
}
rewrite ^(?:application|modules|system)\b.* $install_dir/index.php/$0;
location / {
if ( !-e $request_filename ) {
rewrite.* $install_dir/index.php/$0 last;
}
}
全球nginx规则论坛
dabiantai 发表于 2016-12-14 05:01
set $install_dir /plugins/support;
location.* {
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
那这2行是什么
今晚我是你的 发表于 2016-12-14 05:50
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAM ...
和底下的RewriteRule .* index.php/$0 合起来就是
if ( !-e $request_filename ) {
rewrite.* $install_dir/index.php/$0 last;
}
dabiantai 发表于 2016-12-14 05:01
set $install_dir /plugins/support;
location~ \.* {
我去测试测试。
感谢
dabiantai 发表于 2016-12-14 05:01
set $install_dir /plugins/support;
location~ \.* {
重启的时候会出现
Stoping nginx... nginx: unknown "0" variable
这个错误
cw723 发表于 2016-12-14 09:25
重启的时候会出现
Stoping nginx... nginx: unknown "0" variable
set $install_dir /plugins/support;
location~ /\..+ {
deny all;
}
rewrite ^/((?:application|modules|system)\b.*) $install_dir/index.php/$1 last;
location / {
if ( !-e $request_filename ) {
rewrite(.*) $install_dir/index.php/$1 last;
}
}
厉害了,楼上的程序员
dabiantai 发表于 2016-12-14 10:58
set $install_dir /plugins/support;
location~ /\..+ {
还是不行。
我打算把系统去做成LANMP得了。
页:
[1]