• 请不要在回答技术问题时复制粘贴 AI 生成的内容
sinotw
V2EX  ›  程序员

求助一个 nginx 的 rewrite 的写法

  •  
  •   sinotw · Jul 22, 2020 · 2668 views
    This topic created in 2305 days ago, the information mentioned may be changed or developed.

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

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

    5 replies  •  2020-07-22 21:21:03 +08:00
    march13th
    march13th
    Jul 22, 2020
    1
    mark 等待用例
    我目前还没出现这种需求过
    GM
    GM
    Jul 22, 2020❤️3
    2
    location ~ ^/(?<method>.+)/(?<guid>.*)/(?<entity>.*)$ {
    proxy_pass http://ip:port/method=$method&guid=$guid&entity=$entity;
    }
    zarte
    zarte
    Jul 22, 2020
    3
    一般是把 /a/b/c 变成 host?path=/a/b/c 这样
    byzf
    byzf
    Jul 22, 2020
    4
    你这个路径里是不是少了个?.
    TripleZ
    TripleZ
    Jul 22, 2020 via iPhone
    5
    二楼正解
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   894 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 20:40 · PVG 04:40 · LAX 12:40 · JFK 15:40
    ♥ Do have faith in what you're doing.