Mac 下安裝openresty


本來想着在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

這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章