OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。
$ cd /usr/local/src
$ git clone https://github.com/unixhot/waf.git
$ cp -a /usr/local/src/waf/waf /usr/local/openresty/nginx/conf
vim /usr/local/openresty/nginx/conf/nginx.conf
http { include mime.types; default_type application/octet-stream; lua_shared_dict limit 50m; lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua"; init_by_lua_file "/usr/local/openresty/nginx/conf/waf/init.lua"; access_by_lua_file "/usr/local/openresty/nginx/conf/waf/access.lua";
vim /usr/local/openresty/nginx/conf/waf/config.lua
--if config_waf_output ,setting url config_waf_redirect_url = "https://www.baidu.com" -- 重定向返回的url config_output_html=[[ ... ]]
/usr/local/lib/
去找lualib,然而在编译安装OpenResty时lualib库默认放到/usr/local/openresty/lualib
$ ln -s /usr/local/openresty/lualib /usr/local/lib/lua $ ln -s /usr/local/openresty/lualib/resty /usr/local/openresty/nginx/conf/waf/resty
关于waf的使用,可参考:README
(adsbygoogle = window.adsbygoogle || []).push({});