V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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 · 2277 views
    This topic created in 2118 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
        1
    xiaoyiyu  
       Jul 20, 2020   ❤️ 2
    location = /a/abc {处理逻辑}
    location ^/a {return 30x}
    Mashirobest
        2
    Mashirobest  
    OP
       Jul 20, 2020 via Android
    @xiaoyiyu 非常感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   933 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:47 · PVG 04:47 · LAX 13:47 · JFK 16:47
    ♥ Do have faith in what you're doing.