apache重写规则改写成nginx的规则

Eric 发布于 2014/12/25 10:34
阅读 1K+
收藏 0

第一次接触nginx服务器,请问apache如下的重写规则,改成nginx要怎么改写?

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/adm/ [NC]
RewriteCond %{REQUEST_FILENAME} !^.*\.(gif|jpg|jpeg|png|swf|css|js|txt|ico|xml|cur|ani|mp3|htc)$ [NC]
RewriteRule ^(.*)$ index.php [L]



PS:要如何学习调试配置?

加载中
0
z
zilongzhang
if ($uri !~* "^/adm/"){
	set $rule_0 1$rule_0;
}
if ($request_filename !~* "^.*\.(gif|jpg|jpeg|png|swf|css|js|txt|ico|xml|cur|ani|mp3|htc)$"){
	set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
	rewrite ^/(.*)$ /index.php last;
}

Apache重写规则转换为Nginx
http://www.51ask.org/apache2nginx/

返回顶部
顶部