首页 > 其他 > 详细

nginx+lua (一)

时间:2017-10-05 17:09:54      阅读:257      评论:0      收藏:0      [点我收藏+]

项目工程结构

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  

 

nginx+lua (一)

原文:http://www.cnblogs.com/qingducx/p/7629405.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!