nginx从1.0升级到1.2.7的log_format问题

星期三, 2013-02-20 | Author: Lee | linux | 3,711 views

今天看了nginx的升级到了1.2.7的系列了,自己的还停留在1.0.7版本有点心痒痒了,就升级了下:
不停机平滑升级新版文章参考: //www.pomelolee.com/646.html

通过./sbin/nginx -t 检查发现
[warn] the “log_format” directive may be used only on “http” 的警告信息

修复起来也方便:

把这个格式信息从server 里面移动到http的里面,有多个server 可以并到一起减少了配置(如果格式一样的话,算是新版本的一个优化了)
log_format access ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” $http_x_forwarded_for’;

在通过./sbin/nginx -t 检查 就都ok了

Tags: , ,

文章作者: Lee

本文地址: https://www.pomelolee.com/1165.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta