V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
trepwq
V2EX  ›  问与答

nginx 配置求助, location 和 rewrite 相关

  •  
  •   trepwq · 2016-08-18 17:23:48 +08:00 · 1227 次点击
    这是一个创建于 2815 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在一个 server 下 server{ xxx xxx root /var/www; location /a/b {alias /home/a/b;} xxx xxx }

    现在想 http://www.example.com/a/b/c ,不存在 c 目录或文件,想跳转到 http://www.example.com/a/b b 下面的所有存在或不存在的子路径都跳转到 b 请问怎么配置?怎么最简单实现 自己试了几次改写 location 都不行,必须在 location 下添加 rewrite 吗?

    1 条回复    2016-10-11 11:46:20 +08:00
    trepwq
        1
    trepwq  
    OP
       2016-10-11 11:46:20 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2441 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:41 · PVG 16:41 · LAX 01:41 · JFK 04:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.