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