openresty 开发入门

来源:互联网 发布:怎么跟淘宝客服讲价 编辑:程序博客网 时间:2024/06/04 04:03

文章目录

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
0 0
原创粉丝点击