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

nginx正则匹配的问题

  •  
  •   mechille · Mar 28, 2013 · 3300 views
    This topic created in 4875 days ago, the information mentioned may be changed or developed.
    location / {
    index index.html index.htm index.php;
    rewrite ^/(.*)$ /index.php?/$1;
    }

    配置文件的正则部分如上,但是诸如.css和.jpg结尾的文件也被rewrite了,请问怎么屏蔽
    2 replies    1970-01-01 08:00:00 +08:00
    twm
        1
    twm  
       Mar 28, 2013   ❤️ 1
    if (!-e $request_filename) {
    rewrite ^/(.+)$ /index.php?$1 last;
    }
    mechille
        2
    mechille  
    OP
       Mar 28, 2013
    @twm 感谢已发送
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1209 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 17:21 · PVG 01:21 · LAX 10:21 · JFK 13:21
    ♥ Do have faith in what you're doing.