nginx: [emerg] unknown log format "main"

启动Nginx闪退,然后Windows管理器里也没有相应的进程,通过控制台执行Nginx启动程序,发现以下报错:

nginx: [warn] duplicate extension "eot", content type: "application/octet-stream", previous content type: "application/vnd.ms-fontobject" in D:
ginx-1.5.2/conf/mime.types:64

nginx: [emerg] unknown log format "main" in D:
ginx-1.5.2/conf/nginx.conf:46

通过报错信息,在nginx.conf配置文件找到了log format相应配置项,发现该配置项被注释掉了,放开注释之后就能正常运行了。

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

这个问题可能和之前电脑蓝屏死机之后强制重启有关系,具体原因不明。

"没钱的人,伤心了只能坐在路边,吃点烤串喝点啤酒,然后嗷嗷的哭。有钱就不一样了,可以在温泉哭,可以去九寨沟哭,可以在飞机上哭,可以在游艇上哭,想怎么哭就怎么哭。"

原文地址:https://www.cnblogs.com/yanggb/p/12166813.html