ngx.header.content_type = "text/plain;charset=utf-8"
local cjson = require "cjson" local request_method = ngx.var.request_method;
local args = nil;
args = ngx.req.get_uri_args(); if args["SN"] == nil or args["SN"]=="" then
ngx.print("{\"success\":\"false\",\"info\":\"参数SN不能为空!\"}");
return;
end
local count=; if args["table"]=="ATTLOG" then
ngx.req.read_body();
local body = ngx.req.get_body_data()
local lines=string.split(body,"\n");
count=#lines-; for i=,#lines- do
local l=string.split(lines[i],"\t");
local personId=l[];
local kqTime=l[];
ngx.log(ngx.ERR,"****HuangHai****===>人员id:"..personId,"考勤时间:"..kqTime);
end
end ngx.say("HTTP/1.1 200 OK");
ngx.say("Server: DsidealSuperServer/1.9.0");
local now = os.date("%Y-%m-%d %H:%M:%S", os.time()) ngx.say(now);
ngx.say("Content-Type: text/plain");
ngx.say("Connection: close");
ngx.say("Content-Length:4"); ngx.say("Pragma: no-cache");
ngx.say("Cache-Control: no-store");
ngx.say("");
ngx.say("OK:"..tostring(count)); function string.split(str, delimiter)
if str==nil or str=='' or delimiter==nil then
return nil
end local result = {}
for match in (str..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match)
end
return result
end

vi /usr/local/openresty/nginx/lua/lua_script/kaoqin.lua

在配置文件中添加如下内容:
  location /iclock/
        {
          content_by_lua_file /usr/local/openresty/nginx/lua/lua_script/kaoqin.lua;
        }
示例代码在199上。

查看日志:

tail -f /usr/local/openresty/nginx/logs/error.log | grep ****HuangHai****

最新文章

  1. Appium 服务关键字
  2. Android SQLite (一) 数据库简介
  3. DevExpress GridView 自定义搜索按钮改为中文内容
  4. JSP的九个隐式(内置)对象
  5. iOS---》点击uitableview 的section展开或隐藏
  6. MyBatis学习总结4--解决字段名与实体类属性名不相同的冲突
  7. java中volatitle关键字的作用
  8. 解决mdi窗体闪烁的问题
  9. 如何测试一个U盘
  10. rsync Backups for Windows
  11. Source Map入门教程
  12. servlet研究学习总结--OutputStream和PrintWriter的区别
  13. 索引-mysql
  14. 【译】图解Transformer
  15. .net core 2.0 数据访问-迁移
  16. XXE攻防技术
  17. java ip number to string
  18. MongoDB分布式集群搭建
  19. asp.net分页之AJAX 分页
  20. cmd下查看端口被某程序占用命令

热门文章

  1. 是时候用Coffeescript了
  2. 《算法》C++代码 前言
  3. Appium与python自动测试环境及demo详解
  4. Cannot create a secure XMLInputFactory --CXF调用出错
  5. java初学2
  6. PHP vscode+XDebug 远程断点调试服务器上的代码
  7. sources-x.list
  8. Kickstart配置文件解析
  9. VS配置使用第三方库
  10. HDU 4763 Theme Section ( KMP next函数应用 )