使用/usr/local/nginx/sbin/nginx -t 检查nginx配置文件时报错:

nginx: [emerg] duplicate upstream "test2" in /usr/local/nginx/sites-enabled/test2.conf:1
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

原因:有相同名称的upstream,可以grep查找一下

[root@test sites-enabled]# grep inner-upload *
test2.conf:upstream inner-upload {
test2.conf: proxy_pass http://test2;
test1.conf:upstream inner-upload {
test1.conf: proxy_pass http://test2;

解决方案:改下upstream名称,或者删除之前的upstream

nginx: [emerg] duplicate upstream "test2" in /usr/local/nginx/conf/sites-enabled/test2.conf:1的更多相关文章

  1. nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

    iwangzheng.com tty:[0] jobs:[0] cwd:[/opt/nginx/conf] 12:45 [root@a02.cmsapi]$ /usr/local/nginx/sbin ...

  2. 解决 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

    使用/usr/local/nginx/sbin/nginx -s reload 重新读取配置文件出错 [root@localhost nginx]/usr/local/nginx/sbin/nginx ...

  3. nginx: [emerg] unknown directive "stub_status" in /usr/local/openresty/nginx/conf/conf.d/ngx_metric.conf:19

    问题分析 Nginx没有添加modules/ngx_http_stub_status_module.o模块. 问题解决 没有安装的话,可以在tar包安装编译的时候添加如下参数: # ./configu ...

  4. nginx: [error] invalid PID number "" in "/usr/local/webserver/nginx/logs/nginx.pid" (原)

    进入nginx文件下,例如 :/usr/local/nginx/sbin [root@iZ25f7emo7cZ /]# cd /usr/local/nginx/sbin 运行命令: [root@iZ2 ...

  5. nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:37

    一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 1 nginx: [emerg] the "ssl" parameter requ ...

  6. nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

    当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload   报错类似的错误, nginx: [emerg] unknown directive “ ” in /usr/l ...

  7. nginx: [emerg] unknown directive “ ” in /usr/local/nginx/conf/vhost/XXX.conf:53报错处理

    开发同事发给我一小段nginx配置,加到服务器上之后,执行nginx -s reload时,出现报错: nginx: [emerg] unknown directive “ ” in /usr/loc ...

  8. nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx//conf/nginx.conf:117

    SSL相关的配置加到了nginx的配置文件中后,nginx竟然启动不起来了 于是用如下命令测试问题所在: /usr/local/nginx/sbin/nginx -c /usr/local/nginx ...

  9. 新装NGINX重启,出现错误 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid"

    重装nginx出现,重启出现错误 ./nginx -s reload nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" ...

  10. the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf

    一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 原因也很简单,nginx缺少http_ssl_module模块,编译安装的时候带上--with-htt ...

随机推荐

  1. 用强数据类型保护你的表单数据-基于antd表单的类型约束

    概述 接口数据类型与表单提交数据类型,在大多数情况下,大部分属性的类型是相同的,但很少能做到完全统一. 我在之前的工作中经常为了方便,直接将接口数据类型复用为表单内数据类型,在遇到属性类型不一致的情况 ...

  2. 为React Ant-Design Table增加字段设置

    最近做的几个项目经常遇到这样的需求,要在表格上增加一个自定义表格字段设置的功能.就是用户可以自己控制那些列需要展示. 在几个项目里都实现了一遍,每个项目的需求又都有点儿不一样,迭代了很多版,所以抽时间 ...

  3. 【Javaweb】动态web工程目录介绍

    src 存放自己编写的Java源代码 web 专门用来存放web工程的资源文件(html页面.css文件.js文件等等) WEB-INF 是一个受服务器保护的目录,浏览器无法直接访问此目录的内容 we ...

  4. C# 面试常见递归算法

    前言 今天我们主要总结一下C#面试中常见递归算法. C#递归算法计算阶乘的方法 一个正整数的阶乘(factorial)是所有小于及等于该数的正整数的积,并且0的阶乘为1.自然数n的阶乘写作n!.180 ...

  5. Excel 中使用数据透视图进行数据可视化

    使用数据透视表(PivotTable)是在Excel中进行数据可视化的强大工具.下面将提供详细的步骤来使用数据透视表进行数据可视化. **步骤一:准备数据** 首先,确保你有一个包含所需数据的Exce ...

  6. [USACO2022OPENS] Visits

    题目描述 Bessie 的 \(N\)(\(2\le N\le 10^5\))个奶牛伙伴(编号为 \(1\cdots N\))每一个都拥有自己的农场.对于每个 \(1\le i\le N\),伙伴 i ...

  7. 在CentOS安装BIND,把所有DNS请求日志转发到syslog服务器去

    在CentOS安装BIND,把所有DNS请求日志转发到syslog服务器去 在vim /etc/named.conf里配置的内容 logging { channel default_debug { f ...

  8. SQL注入Fuzzing字典

    需要的自取 ' " # - -- ' -- --'; ' ; = ' = ; = -- \x23 \x27 \x3D \x3B' \x3D \x27 \x27\x4F\x52 SELECT ...

  9. 用Python来查询聊天记录

    用Python来查询聊天记录 代码 import re def Start(First_Date, Second_Date, First_Name, Second_Name): First = re. ...

  10. react 事件函数中 this 绑定问题

    在使用类方式创建组件时,类中定义一个函数,并且绑定到元素的点击事件上,此时这个函数中this指向并不是当前这个组件. 组件代码如下: class App extends React.Component ...