Home  >  Q&A  >  body text

Will Nginx's rewrite function be discarded? Are the parameters passed in?

server {
  if ($host ~* ^example.com) {
    rewrite ^(.*) http://www.example.com permanent;
  }
}

When I send a request like http://example.com/aa.jsp?time=1. The forwarded request becomes http://www.example.com/aa.jsp Are the parameters after the question mark discarded? ? ?

How to set the parameters after the question mark is discarded by the Ministry of Energy? thanks, thanks

仅有的幸福仅有的幸福2713 days ago538

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 17:26:51

    Later I found out that I actually made a mistake during the test. . . After perfecting the test conditions, everything is normal. Thank you for your reply

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 17:26:51


    if ($host = 'example.com' ) {
    rewrite ^/(.*)$ http://www.example.com/$1 permanent;
    }

    reply
    0
  • Cancelreply