search

Home  >  Q&A  >  body text

Nginx request forwarding problem

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~~

曾经蜡笔没有小新曾经蜡笔没有小新2809 days ago475

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 17:24:23

    rewrite ^/(en|cn)/(.*)$ /?siteid= last permanent;

    Put it in the block of location /

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 17:24:23

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

    reply
    0
  • Cancelreply