时间:2022-10-12 10:23:56
网站配置由apche换成nginx系统后,重启时出现错误提示
Nginx配置规则错误:
nginx: [emerg] unknown log format "main" in /www/server/panel/vhost/nginx/www.caishui1688.com.conf:97
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
打开nginx.conf,"main"错误是因为丢失了log_format选项,因为之前做过CDN获取真实IP,后来这个删除了,将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"';
09-19