2.官网下载源码包
http://openresty.org/cn/download.html
4.源码编译
./configure --prefix=/usr/local/openresty/ --with-http_stub_status_module --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_postgres_module --with-stream
gmake && gmake install
5.添加环境变量
vim /etc/profile
PATH=/usr/local/openresty/nginx/sbin:$PATH
export PATH
6.配置文件编写
vim conf/nginx.conf # 内容就是nginx配置文件格式
7.启动
nginx -p pwd
/ -c conf/nginx.conf
原文:https://blog.51cto.com/haoyonghui/2377398