nginx rewrite 匹配

字体大小: 中小 标准 ->行高大小: 标准

在nginx 前端做rewrite转向,动态页转向某静态地址。

例如:

/home/index.html?growingId=([0-9]+)$ 转向到 /people/([0-9]+)

 

用下面的方法搞定。

if ($query_string ~ “growingId=(.*)”) {
set $growingId $1;
rewrite ^/home/index.html.* /people/$growingId/ last;
}

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/67648.html