rewrite ^/z_([0-9]+)\.html$ /initPingCe.do?topicid=$1 last;
rewrite ^/a_([0-9]+)_([0-9]+)_([0-9]+)\.html$ /answerPingCe.do?topicid=$1&questionorder=$2&answerid=$3 last;
rewrite ^/c_([0-9]+)_([0-9]+)\.html$ /conclusionPingCe.do?topicid=$1&conclusionid=$2 last;
rewrite ^/v_([0-9]+)_([0-9]+)\.html$ /votePingCe.do?topicid=$1&conclusionid=$2 last;
rewrite ^/l_([0-9]+)_([0-9]?)\.html$ /pingCeList.do?ttid=$1&page=$2 last;
rewrite "^/.*jsessionid.*" http://ceshi.test.com/ last;
rewrite ^/a_([0-9]+)_([0-9]+)_([0-9]+)\.html$ /answerPingCe.do?topicid=$1&questionorder=$2&answerid=$3 last;
rewrite ^/c_([0-9]+)_([0-9]+)\.html$ /conclusionPingCe.do?topicid=$1&conclusionid=$2 last;
rewrite ^/v_([0-9]+)_([0-9]+)\.html$ /votePingCe.do?topicid=$1&conclusionid=$2 last;
rewrite ^/l_([0-9]+)_([0-9]?)\.html$ /pingCeList.do?ttid=$1&page=$2 last;
rewrite "^/.*jsessionid.*" http://ceshi.test.com/ last;
rewrite 主要就是正则匹配结合业务需求即可。
本文转自pandazhai 51CTO博客,原文链接:http://blog.51cto.com/dreamway/1045587