在 access 和 content 阶段ngx.exit(非0状态码)时log阶段不会执行
但是希望log阶段执行有什么好办法么。。还是得自己写方法全部ngx.exit(0)再下个阶段最开始做判断?求大牛们指点。。 --
2016-11-22 13:00 GMT+08:00 <seel...@gmail.com>:在 access 和 content 阶段ngx.exit(非0状态码)时log阶段不会执行nginx 配置: location /test { content_by_lua_block { return ngx.exit(302) } log_by_lua_block { ngx.log(ngx.ERR, "hit log phase") } }在这里示例中,最后可以在默认日志文件中看到:2016/11/22 21:26:45 [error] 1094#0: *6 [lua] log_by_lua(nginx.conf:30):2: hit log phase while logging request, client: 127.0.0.1, server: , request: "GET /test HTTP/1.1", host: "127.0.0.1:8866" 但是希望log阶段执行有什么好办法么。。还是得自己写方法全部ngx.exit(0)再下个阶段最开始做判断?求大牛们指点。。 -- -- YuanSheng Wang---------------------------------------My Github: https://github.com/membphisOpenResty lover ^_^