您的位置:首页 > 运维架构 > Nginx

nginx+lua (一)

2017-10-05 16:53 155 查看
项目工程结构

hello

hello.conf

lua

hello.lua

lualib

*.lua

*.so

新建hello.conf

server {

listen 80;

server_name _;

location /lua {

default_type 'text/html';

lua_code_cache off;

content_by_lua_file /usr/example/lua/test.lua;

}

}

新建 test.lua脚本

ngx.say("hello world"); (测试脚本)

增加配置

/usr/servers/nginx/conf/nginx.conf

在http中 include /usr/hello/hello.conf;

查看异常日志

tail -f /usr/servers/nginx/logs/error.log

重新nginx加载配置

/usr/servers/nginx/sbin/nginx -s reload
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: