nginx: [emerg] duplicate "log_format" name "access"
来源:互联网 发布:plc编程前景 编辑:程序博客网 时间:2024/05/27 00:40
nginx在开启多个虚拟主机日志时,会出现如下错误提示:
nginx: [emerg] duplicate "log_format" name "access" in /etc/nginx/sites-enabled/www.exp.com:2
其实就是因为nginx.conf配置文件在多个access_log中使用了同一个log_format访问;
解决方法:在其它虚拟主机配置文件中,将log_format更改为(access_exp)其它名称,如下
#Log Format log_format access_exp '$time_iso8601 | $remote_addr | $request | $status | $request_body | $http_referer | $http_user_agent | $http_x_forwarded_for'; server { listen 80; root /var/www/exp/web; index index.php index.html index.htm; server_name www.exp.com; # log access_log /var/log/nginx/www.exp.com.access.log access_exp; error_log /var/log/nginx/www.exp.com.error.log; #location /www.exp.com/ { 。。。。。。。
重新加载nginx的使配置生效 nginx -s reload
阅读全文
0 0
- nginx: [emerg] duplicate "log_format" name "access"
- nginx: [emerg] duplicate listen options for [::]:80
- nginx - log_format
- Nginx warn] the "log_format"
- nginx log_format for webalizer
- nginx log_format详解
- Nginx配置文件简单说明log_format
- nginx log_format 变量含义详解
- nginx: [emerg] open() "/usr/local/nginx/logs/access.log" failed (21: Is a directory)
- nginx: [emerg] unexpected “}”
- [emerg]: getpwnam(“nginx”) failed
- Nginx 用log_format设置日志格式
- Nginx 用log_format设置日志格式
- nginx: [emerg] unknown "scripts" variable
- nginx:[emerg]unknown directive "ssl"
- nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way
- nginx:[emerg] bind<>to 0.0.0.0:80 failed <10013: An attempt was made to access a s ocket
- 报错nginx: [emerg] getgrnam("nginx") failed
- java_集合体系之List体系总结、应用场景
- golang websocket 服务器
- 任意阶幻方的解法及c++实现
- mybatis的逆向工程使用实现
- Codeforces 327D Block Tower【思维+Bfs】
- nginx: [emerg] duplicate "log_format" name "access"
- 欢迎使用CSDN-markdown编辑器
- cinder 创建backup volume
- 最大公约数
- 系统学习 jQuery (三) 选择器
- 程序员最核心的竞争力是什么?
- Error:Failed to open zip file. Gradle's dependency cache may be corrupt
- 吴军博士《智能时代》阅读笔记
- 【Spring】Spring Framework Reference Documentation中文版23