Openresty入门
安装
Mint19
打开openresty
官网下载源码包安装
tar -zxvf openresty-1.15.8.1.tar.gz
cd openresty-1.15.8.1
./configure
make
sudo make install
# 安装完成后默认目录在 /usr/local/openresty,可在configure中指定参数自定义
Hello Openresty
- 修改
nginx
配置文件,增加如下节点
location /hello {
content_by_lua_file /home/wyd/lua/hello.lua;
}
- 新增
hello.lua
脚本文件vi /home/wyd/lua/hello.lua