V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
bztwh
V2EX  ›  NGINX

nginx 正则问题

  •  
  •   bztwh · 2020-03-04 11:43:25 +08:00 · 1354 次点击
    这是一个创建于 1485 天前的主题,其中的信息可能已经有所发展或是发生改变。

    location 配置

    location /test/page/ {
        alias C:/test/html/;
        index  index.html index.htm;
    }
    location /test/page1/ {
        alias C:/test/html/;
        index  index.html index.htm;
    }
    

    192.168.2.100:8000/test/page/ 192.168.2.100:8000/test/page1/ 都可以正常访问

    location 配置

    location ~ /test/page(\d+)/ {
        alias C:/test/html/;
        index  index.html index.htm;
    }
    

    访问 192.168.2.100:8000/test/page1/ 地址就会变成 192.168.2.100:8000/test/page1/index.html/index.html/index.html/index.html/index.html/...

    求教这里应该如何配置

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   948 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:02 · PVG 05:02 · LAX 14:02 · JFK 17:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.