查看单个帖子
flashhand
 
flashhand 的头像
超级会员
 
资 料:
注册日期: May 2000
帖子: 1,667 声望值: 4
精华: 0,解答: 1
#1 旧 2012-05-12, 10:56:03 默认 【求助】请帮改写一段apache的rewirte到nginx上
flashhand 当前在线  

原来是用apache的rewrite转发,现在要用到nginx上,如何转换呢?请师兄指点:

RewriteLogLevel 9
RewriteRule ^/ajax/([^/]+)/([^/]+)/([^/]+)(/(.+))?$ /ajax/$2.php?resp_type=$1&act=$3&$5 [QSA,L,P]
RewriteRule ^/combo/__[^/]+/([^?]*)$ /combo.nox.apache.php?$1 [QSA,L]
RewriteRule ^(.*?)__(\d+\.\w+)$ /i/$1?$2 [QSA,L]
RewriteRule ^.+\.(gif|jpg|js|png|jpg|css)$ /i/$0? [L]
RewriteRule ^/(\w{5,})$ /index.php?sn=$1&c=u&m=feed [QSA,L,P]
RewriteRule ^/(\w{5,})/([^/]+)?$ /index.php?sn=$1&c=u&m=$2 [QSA,L,P]

转成nginx特别是下面这句覍的不对:

rewrite ^.+\.(gif|jpg|js|png|jpg|css)$ /i/$0? last;