Nginx request forwarding problem
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 17:22:23
0
2
410

I want to forward the request to:
http://www.demo.com/en/group/index/test
To:
http://www.demo.com/group/ index/test?siteId=en;
The parameter en after the national variable siteId is the /en/ in the previous URL. How to write this rule in Nginx?

I hope God can give me some guidance, thank you very much~~

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
过去多啦不再A梦
rewrite ^/(en|cn)/(.*)$ /?siteid= last permanent;

Put it in the block of location /

漂亮男人

What you have to do is not forwarding, but URL redirection. So you can use nginx rewrite
rewrite summary

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!