Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created October 13, 2012 00:16
Show Gist options
  • Save jugyo/3882497 to your computer and use it in GitHub Desktop.
Save jugyo/3882497 to your computer and use it in GitHub Desktop.
nginx + ngx_lua on Mac

Installation

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

Tips

logging

ngx.log(ngx.ERR, "foo")
@adong
Copy link

adong commented Feb 23, 2017

brew --version
Homebrew 1.1.10
Homebrew/homebrew-core (git revision 697d; last commit 2017-02-22)

Try this for

 brew install homebrew/nginx/nginx-full --with-lua-module --with-set-misc-module

@jeffbondlink
Copy link

Thanks for commenting on an old post @adong, exactly what i needed.

@gingerr
Copy link

gingerr commented Mar 31, 2018

New year, new steps to do it:
brew tap denji/nginx
brew install homebrew/nginx/nginx-full --with-lua-module --with-set-misc-module

https://github.com/denji/homebrew-nginx

@abhijit-paul-blippar
Copy link

Since homebrew/nginx is deprecated, using:

brew tap denji/nginx; 
brew install nginx-full --with-lua-module --with-set-misc-module

worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment