› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
Mashirobest
V2EX  ›  NGINX

除开某个页面做重定向

  •  
  •   Mashirobest · Jul 20, 2020 · 2688 views
    This topic created in 2299 days ago, the information mentioned may be changed or developed.

    最近学着架了个网站,不太熟悉 nginx 语法,想请教下各位,如果要除开某个页面做重定向应该怎么写?例如除了页面“https://域名 a/abc”,把域名 a 下面所有链接都重定向到域名 b 。

    2 replies  •  2020-07-20 14:47:20 +08:00
    xiaoyiyu
    xiaoyiyu
    Jul 20, 2020❤️2
    1
    location = /a/abc {处理逻辑}
    location ^/a {return 30x}
    Mashirobest
    Mashirobest
    OP
    Jul 20, 2020 via Android
    2
    @xiaoyiyu 非常感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1412 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:06 · PVG 03:06 · LAX 11:06 · JFK 14:06
    ♥ Do have faith in what you're doing.