尝试了多个方案就春哥的lua靠谱
再编译nginx加上2个模块
--add-module=../lua-nginx-module-0.9.2--add-module=../ngx_devel_kit-0.2.19
vhost里加下面的配置
location /{if($uri ~[A-Z]){
rewrite_by_lua 'return ngx.redirect(string.lower(ngx.var.uri),ngx.HTTP_MOVED_PERMANENTLY)';}
}
常见错误
# /usr/local/nginx-1.4.2/sbin/nginx -v
./objs/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
解决方法:
# ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2
http://www.ttlsa.com/nginx/nginx-modules-ngx_lua/
<a href="http://down.51cto.com/data/2364309" target="_blank">附件:http://down.51cto.com/data/2364309</a>
本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/1396291