- Tengine v2.1.2 ( Openresty , Nginx 亦可)
- Redis v3.2.5
- Centos 6.5
unixsocket /data/logs/redis_logs/redis.sock
port 0
vhostdomain.conf :
location / {
rewrite_by_lua_file /path_to_basedir_of_shorturl/redirect.lua;
}
location /shorturl {
content_by_lua_file /path_to_basedir_of_shorturl/create_shorturl.lua;
}
nginx.conf :
lua_package_path "/path_to_basedir_of_shorturl/lualibs/?.lua;;";
init_by_lua_file /path_to_basedir_of_shorturl/init.lua ;
curl http://surl.ops.vyohui.com/shorturl -X POST -d 'url=http://www.baidu.com'