mac 安装 openresty

1.环境homebrew 1.3.1

在hombrew 默认路径为 /usr/local/opt

1.step

brew update

2.step

brew install pcre openssl

3.step

brew install homebrew/nginx/openresty

4.step

brew tap homebrew/nginx

5.step

brew install homebrew/nginx/openresty

6.step

PATH=/usr/local/opt/openresty/nginx/sbin:$PATH

7.step

export PATH

Hello world

mkdir ~/work
cd ~/work
mkdir logs/ conf/

创建配置文件

worker_processes  1;        #nginx worker 数量
error_log logs/error.log;   #指定错误日志文件路径
events {
    worker_connections 1024;
}

http {
    server {
        listen 6767;
        location / {
            default_type text/html;
            content_by_lua {
                ngx.say("HelloWorld")
            }
        }
    }
}
nginx -p `pwd`/ -c conf/nginx.conf
curl  127.0.0.1:6767
hello world
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容