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

nginx 正则问题

  •  
  •   bztwh · Mar 4, 2020 · 1980 views
    This topic created in 2323 days ago, the information mentioned may be changed or developed.

    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/...

    求教这里应该如何配置

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1046 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:55 · PVG 06:55 · LAX 15:55 · JFK 18:55
    ♥ Do have faith in what you're doing.