【发布时间】:2019-01-24 09:10:08
【问题描述】:
我正在尝试使用 Nginx 重写 URL,以下是输入和预期输出。
输入:http://localhost/test/studentinfo/DocumentViewer?studentName=ABC&age=25&SchoolName=TREDS&city=HYD
预期输出:http://localhost/student?studentName=ABC&city=HYD
因此,每当我尝试重写 URL 时,我都会在实际替换的 URL 后面得到整个参数 URL,如下所示。
我的重写逻辑:
rewrite ^/test/* /student?studentName=$arg_studentName&city=$arg_city permanent;
但我收到的输出是: http://localhost/student?studentName=ABC&city=HYDstudentName=ABC&age=25&SchoolName=TREDS&city=HYD.
关于我犯了什么错误以及如何实现输出的任何想法。
谢谢!
【问题讨论】:
标签: nginx url-rewriting nginx-config