解决错误:nginx: [emerg] unknown log format “main” in
![解决错误:nginx: [emerg] unknown log format “main” in-下一朵云](https://myoss.orcy.net.cn:9000/oss-orcy-img/20210324111720.jpg)
重启nginx是出现了如下错误:
nginx: [emerg] unknown log format “main” in /usr/local/nginx/nginx.conf:124
解决办法:
打开nginx.conf,”main”错误是因为丢失了log_format
选项,默认把他屏蔽掉了,修改之后问题解决
![解决错误:nginx: [emerg] unknown log format “main” in-下一朵云](https://myoss.orcy.net.cn:9000/oss-orcy-img/20210326124314.png)
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"';
#access_log logs/access.log main;