需求:
http[s]://weidian.com/plaza/searchAll.html?tb_search=连衣裙&type=item -》https://h5.weidian.com/m/search/searchlist/index.html?keyword=连衣裙&type=商品
http[s]://weidian.com/plaza/searchAll.html?tb_search=连衣裙&type=shop -》https://h5.weidian.com/m/search/searchlist/index.html?keyword=连衣裙&type=店铺
上面需求可以看出:参数由tb_search 变为keyword,其他正常rewrite即可
nginx前端有负载均衡情况下,对外不能访问
location ~ ^/order/manage/(.*) { set $flagManage 0; if ($host != 'idc01-wd-order-vip00'){ set $flagManage "${flagManage}1"; } if ($host != 'idc01-wd-order-vip00.dns.koudai.com'){ set $flagManage "${flagManage}2"; } if ($host != '10.2.16.204'){ set $flagManage "${flagManage}3"; } if ($flagManage = "0123"){ return 400; } }
location ~ ^/express/manage/(.*) { set $flagManage 0; if ($host ~ (idc01-wd-express-vip00|idc01-wd-express-vip00.dns.koudai.com)){ set $flagManage 1; } if ($flagManage = 0){ return 400; } if ($flagManage = 1){ rewrite ^/express/(.*)$ /express/index.php?$1 break; } } if ($uri !~ "^/express/manage/"){ rewrite ^/express/(.*)$ /express/index.php?$1 last; }
解:
rewrite ^/plaza/searchAll.