1. 问题描述
nginx 1.4.6版本,在nginx.conf的server里配置了log_format,使用命令:nginx -t检查配置文件,报警告:
nginx: [warn] the "log_format" directive may be used only on "http" level in /etc/nginx/nginx.conf
2.解决办法
只需要把log_format配置移到server上面,同样是在http块里即可。
nginx 1.4.6版本,在nginx.conf的server里配置了log_format,使用命令:nginx -t检查配置文件,报警告:
nginx: [warn] the "log_format" directive may be used only on "http" level in /etc/nginx/nginx.conf
2.解决办法
只需要把log_format配置移到server上面,同样是在http块里即可。