log的位置
log的位置是可以自定义的,比如你的启动方式如下
openresty -p /opt/apps -c conf/main-nginx.conf
那么log的位置就在main-nginx.conf
中有定义,比如配置文件有这么一句
error_log
是指令 后面是log的位置
,最后一个error是log级别. 这个位置是相对于配置文件所在的位置
而言的.log名字也是可以自定义的
error_log logs/myerror.log error;
举个例子
比如页面无响应内容,但是openresty也不报错,就需要查看log
log位置
/usr/local/openresty/nginx/logs/error.log
比如如下内容,就表明你在nginx配置中写的lua脚本有错误,错误在remote_user
这里
2020/12/12 09:13:37 [error] 2725#2725: *146 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/luatest/tmp.lua:3: attempt to concatenate field 'remote_user' (a nil value)
stack traceback:
coroutine 0:
总结
- log位置
nginx/logs