coolair
V2EX  ›  问与答

请教一个 nginx rewrite 规则写法

  •  
  •   coolair · Oct 14, 2021 · 1014 views
    This topic created in 1672 days ago, the information mentioned may be changed or developed.
    2 replies    2021-10-14 16:55:00 +08:00
    wdssmq
        1
    wdssmq  
       Oct 14, 2021
    {
    listen 8000;
    rewrite /media/avatar/(.+) http://a.test.com:8888/media/avatar/$1 permanent;
    }
    privil
        2
    privil  
       Oct 14, 2021
    直接 location proxy_pass 也行啊 你这路径都不带改的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   940 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 21:26 · PVG 05:26 · LAX 14:26 · JFK 17:26
    ♥ Do have faith in what you're doing.