本來想着在mac上,基於install nginx上安裝nginx_lua,無奈沒有找到破解方法
於是在mac上通過openresty來測試nginx lua
安裝很簡單
brew update
brew install openresty/brew/openresty
openresty -V # 檢查版本及支持模塊
默認openresty 下 nginx配置文件
/usr/local/etc/openresty/nginx.conf
## 添加測試代碼
location /hello_lua {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}
測試訪問,看lua是否工作
curl localhost:80/hello_lua