unknown log format "main" in /nginx/conf/nginx.conf


vi /nginx/conf/nginx.conf找到http{ }模块中的 log_format去掉注释,或是log_format写到了别处。

解决方法:

将log_format 写到http开头

1
2
3
4
5
6
7
8
http
{
 
  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  /opt/logs/nginx/access.log  main;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM