首先安装 LUA 库:apt-get install liblua5.1-dev

然后重新编译 Tengine 时增加--with-http_lua_module

接着修改网站配置文件:

location ~ [A-Z] {
  rewrite_by_lua 'ngx.exec(string.lower(ngx.var.uri))';
}

最后重启 Tengine 即可.