版本:nginx/1.6.2
报错:
0 1 2 |
nginx: [warn] the "log_format" directive may be used only on "http" level in /usr/local/nginx/conf/extra/www.conf:9 nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful |
解决方法:日志配置信息写在server前面即可。
0 1 2 3 |
log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' ; access_log /usr/local/nginx/logs/access.log main; |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!