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

原文地址为:解决错误:nginx: [emerg] unknown log format "main" in

重启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;
}

转载请注明本文地址:解决错误:nginx: [emerg] unknown log format "main" in
文章来源: 解决错误:nginx: [emerg] unknown log format "main" in

人吐槽 人点赞

猜你喜欢

发表评论

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:解决错误:nginx: [emerg] unknown log format "main" in