› 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 · 3431 views
    This topic created in 4972 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
    twm
    Mar 28, 2013❤️1
    1
    if (!-e $request_filename) {
    rewrite ^/(.+)$ /index.php?$1 last;
    }
    mechille
    mechille
    OP
    Mar 28, 2013
    2
    @twm 感谢已发送
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 08:32 · PVG 16:32 · LAX 00:32 · JFK 03:32
    ♥ Do have faith in what you're doing.