Nginx regular jump http jump https and path jump

http jump https

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

Match path https://your web address/activity/14286.html forward to path https://your web address/pages/activity/detail?id=14286 


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

The above is a reference example for regular matching rules, please refer to the official documentation

Guess you like

Origin blog.csdn.net/qq_39313596/article/details/103703054