Ourls-Resty 介绍
Ourls-Resty 是对 @L_502_0@ 的移植。将原 PHP 移植到
OpenResty 平台。
Ourls 是由
takashiki 实现的一个基于发号和 hashid 的短网址服务。
受这个项目的启发,将此项目移植到 OpenResty 。
Github Release 提供了 Cent7 x86_64 下的打包。其他平台可手动编译 Lua C 库。
安装方法:
-
安装 gcc、make、libidn、libidn-devel (yum gcc make install libidn-devel)
-
将本工程解压到 openresty 目录,执行 install.sh (bash install.sh)
-
启动 openresty (service openresty start)
详细编译安装以及配置说明请参考 说明
最后参照下面的配置,与你的 Nginx 配置合并。
root html/ourl; index index.html; location / { try_files $uri $uri/ @app; } location @app { internal; default_type text/html; content_by_lua_block { local t = require 'ourl' t.run() }