文章目录
1、openresty 安装
2、lua 测试程序
3、nginx.conf 文件配置
4、系统启动
1、openresty 安装
(1) 下载 openresty-1.9.15.1.tar.gz;
(2) tar -xzvf openresty-1.9.15.1.tar.gz;
(3) 进入 openresty-1.9.15.1;
(4) ./configure --prefix=/opt/openresty/;
(5) make && make install;
2、lua 程序
hello.lua 文件
ngx.say("hello world!")
3、nginx.conf 文件配置
在 server 中配置下面内容
location /lua {
default_type 'text/html';
content_by_lua_file /srv/app/api-server-high/hello.lua;
}
4、系统启动
/openresty 安装路径/nginx/sbin/nginx -c /openresty 安装路径/nginx/conf/nginx.conf