nginx 正则跳转 http跳转https以及路径跳转

http跳转https

 server {
        listen 80;
        server_name 你的网页地址;
        rewrite ^(.*) https://你的网页地址$1 permanent;
        }

匹配路径https://你的网页地址/activity/14286.html   转发到路径https://你的网页地址/pages/activity/detail?id=14286 


 location ~* ^/(activity/)(.*)(\.html)$ {
               rewrite ^/(activity/)(.*)(\.html)$ https://你的网页地址/pages/activity/detail?id=$2;
        }

以上是参考例子 正则匹配规则请参考官方文档

猜你喜欢

转载自blog.csdn.net/qq_39313596/article/details/103703054
今日推荐