您的位置:首页 > 运维架构 > Nginx

解决错误:nginx: [emerg] unknown log format "main" in

2012-12-30 23:13 821 查看
重启nginx是出现了如下错误:

nginx: [emerg] unknown log format "proxy_log" in /usr/local/macports/etc/nginx/nginx.conf:147

解决办法:

打开nginx.conf,"main"错误是因为丢失了log_format选项,之前把他屏蔽掉了,修改之后问题解决。

user					             nginx nginx;
pid					             /var/log/nginx/nginx.pid;
worker_processes		    8;
worker_rlimit_nofile		    1024;
events {
	worker_connections     2048;
	use epoll;
 }
http {
	include				   mime.types;
	default_type		   application/octet-stream;

        log_format		main	'$remote_addr - $remote_user [$time_local] $request '
					'"$status" $body_bytes_sent "$http_referer" '
					'"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"';access_log			off;
	error_log			   /var/log/nginx/error.log error;
        include				  localhost.conf;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐