首页
开源项目
闲篇
元编程
Golang
精粹
技术探讨
服务
首页
开源项目
大会
报名参会
报名查询
加入中国C++ User Group
大会调查
社区服务
网站首页
文章专栏
nginx的多参数的伪静态设置
nginx的多参数的伪静态设置
编辑时间:2024-11-09 16:51:13
作者:cocapai
0条评论
出自:cocapai
地址:
www.cocapai.com
转载请注明出处!
/list?cate=123&city=391100&page=1映射/list/cate-123/city-391100/page-1.html ``` location / { set $city_param ""; set $cate_param ""; set $keyword_param ""; set $page_param ""; if ($uri ~* /city-(\d+)) { set $city_param "city=$1&"; } if ($uri ~* /cate-(\d+)) { set $cate_param "cate=$1&"; } if ($uri ~* /page-(\d+).html) { set $page_param "page=$1&"; } if ($uri ~* /keyword-([^\x00-\x7F]+).html) { set $keyword_param "keyword=$1&"; } set $custom_query_string "${city_param}${cate_param}${keyword_param}${page_param}"; if ($custom_query_string) { rewrite ^/list /list?$custom_query_string last; rewrite ^/article /article?$custom_query_string last; } } ```
来说两句吧
2096
提交评论
登录才能发表评论。
最新评论
COCAPAI
一个很酷的卡派
这里有创新的idea,这里有最酷的卡派
分类导航
精华
开源项目
活动
元编程
代码精粹
技术探讨
故事
友情链接
COCAPAI