1. 首页
  2. 数据库
  3. 其它
  4. nginx: [warn] “log_format” directive used only on “http” level 解决方法

nginx: [warn] “log_format” directive used only on “http” level 解决方法

上传者: 2021-01-16 19:41:22上传 PDF文件 37.79KB 热度 22次
将nginx升级到1.2.4稳定版之后,会发现之前的vhost/*.conf中的日志配置都报了如下的warn: 代码如下: nginx: [warn] the “log_format” directive may be used only on “http” level 上网搜索解决方案如下: 将/vhost/xxx.conf里server段里的下面代码移出该server段即可。 但是这样的又会产生一个问题,就是各子域名的日志文件都会记录所有请求的日志,等了好久都没找到解决方案,后来请教了飞飞之后终于找到解决的方法了。 原来log_format需要在nginx.conf的http层定义,然后
下载地址
用户评论