求助一个 nginx 的 rewrite 的写法

2020-07-22 16:29:48 +08:00
 sinotw

请求的 url: http://ip:port/a/b/c 跳转的 url: http://ip:port/mothed=a&guid=b&entity=c

大神们指点指点,不胜感激

1430 次点击
所在节点    程序员
5 条回复
march13th
2020-07-22 16:55:53 +08:00
mark 等待用例
我目前还没出现这种需求过
GM
2020-07-22 16:57:49 +08:00
location ~ ^/(?<method>.+)/(?<guid>.*)/(?<entity>.*)$ {
proxy_pass http://ip:port/method=$method&guid=$guid&entity=$entity;
}
zarte
2020-07-22 17:20:31 +08:00
一般是把 /a/b/c 变成 host?path=/a/b/c 这样
byzf
2020-07-22 18:56:24 +08:00
你这个路径里是不是少了个?.
TripleZ
2020-07-22 21:21:03 +08:00
二楼正解

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/692228

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX