http://wiki.nginx.org/HttpLuaModule#Installation
install LuaJIT
$ brew install luajit
download ngx_devel_kit
$ cd /usr/local/src
$ git clone https://github.com/simpl/ngx_devel_kit.git
download lua-nginx-module
$ cd /usr/local/src
$ git clone https://github.com/chaoslawful/lua-nginx-module.git
add configure options (via brew edit nginx
)
--add-module=/usr/local/src/ngx_devel_kit
--add-module=/usr/local/src/lua-nginx-module
compile nginx
$ export LUAJIT_LIB=/usr/local/Cellar/luajit/2.0.0-beta10/lib
$ export LUAJIT_INC=/usr/local/Cellar/luajit/2.0.0-beta10/include/luajit-2.0
$ brew install nginx
logging
ngx.log(ngx.ERR, "foo")
If you want to use the
set_by_lua
directive, thengx_devel_kit
module also needs to be installed.The
nginx-full
formula already adds this module when theset-misc
module should be installed.