解决办法来自于:https://blog.csdn.net/Hreticent/article/details/86074502

感谢这个朋友简单而清晰的解决办法。

在配置nginx支持PHP的时候,因为之前有站点,配置的比较乱。尤其是支持JSP

导致重启nginx时,一直报错 nginx: [emerg] host not found in upstream 类似这样的报错。

各种不明白为何如此,不得不到处搜索解决办法,真的是好多办法,就是没几个能看懂的,不知道都在说什么。

有很多参考做都无法实现。

后来终于看到一个简单的解决办法。

就是因为当前系统无法解析upstream后边跟着的域名。导致无法重启。

解决办法也很简单,就是修改hosts文件,像WIN系统一样。

vi /etc/hosts

127.0.0.1 www.xxx.com

添加上边一条相似的信息,在IP后边增加那个upsteam后边的那个域名。

这样问题就解决了。

解决 nginx 启动错误 nginx: [emerg] host not found in upstream的更多相关文章

  1. check nginx配置文件错误:[emerg]: getpwnam(“nginx”) failed

    1.错误提示: [root@server include]# /application/nginx/sbin/nginx -t -c /applications/nginx/nginx/nginx.c ...

  2. nginx 启动错误

    场景 在Windows下 启动nginx报错: nginx: [error] ReadFile() : Incorrect function) 解决 因为 nginx.conf 中存在 /* 被认为是 ...

  3. Nginx启动错误 Failed to read PID from file /run/nginx.pid 的处理方法

    问题产生原因 因为 nginx 启动需要一点点时间,而 systemd 在 nginx 完成启动前就去读取 pid file 造成读取 pid 失败 解决方法 让 systemd 在执行 ExecSt ...

  4. Nginx启动错误:error while loading shared libraries: libpcre.so.1

    1 # /usr/local/nginx/sbin/nginx 2 /usr/local/nginx/sbin/nginx: error while loading shared libraries: ...

  5. Nginx启动错误:error while loading shared libraries: libpcre.so.0

    今天测试的时候,启动一个其他机器预编译好的nginx到目标测试机器(OEL 7.4)启动的时候,报了下列错误: /usr/local/nginx/sbin/nginx: error while loa ...

  6. 解决apache启动错误 AH00558: httpd: Could not reliably determine...

    [root@localhost httpd-2.4.7]# /usr/local/httpd/bin/apachectl start AH00558: httpd: Could not reliabl ...

  7. 解决apache启动错误"httpd:Could not reliably determine..."

    启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name [root@serv ...

  8. 解决 spring-cloud-starter-zipkin 启动错误

    应用场景:Spring Boot 服务添加 Zipkin 依赖,进行服务调用的数据采集,然后进行 Zipkin-Server 服务调用追踪显示. 示例pom.xml配置: <parent> ...

  9. 解决docker启动错误 error creating overlay mount to /var/lib/docker/overlay2

    原文 最近在centos7.1使用docker运行redis镜像,出现下面的错误: /usr/bin/docker-current: Error response from daemon: error ...

随机推荐

  1. case...when...和decode——oracle

    1.decode函数: 用法:decode(条件,值1,翻译1,值2,翻译2,......,缺省值): 例子: ','失败','未知') from table t1;--改变字段的显示值 ,变量1,变 ...

  2. css 径向渐变

    .example { width: 150px; height: 80px; background: -webkit-radial-gradient(red, green, blue); /* Saf ...

  3. SpringMVC错误,商品添加信息HTTP Status 400 – Bad Request

    记录一个自己在做商品信息显示与传递数据的时候出现的错误, HTTP Status 400 – Bad Request Type Status Report Description The server ...

  4. Android自定义View——贝塞尔曲线实现水波纹效果

    我们使用到的是Path类的quadTo(x1, y1, x2, y2)方法,属于二阶贝塞尔曲线,使用一张图来展示二阶贝塞尔曲线,这里的(x1,y1)是控制点,(x2,y2)是终止点,起始点默认是Pat ...

  5. Linux 下 OpenCV3 安装

    编译安装OpenCV3 从官网下载:http://opencv.org/releases.html 选择一个较新版本的opencv3.X,下载source源代码 下载之后解压,并cd到该文件夹进行编译 ...

  6. Tensorflow Mask-RCNN(三)——实时 检测视频

    参考:https://www.youtube.com/watch?v=lLM8oAsi32g import cv2    import numpy as np              def ran ...

  7. eclipse maven配置问题:org.apache.maven.archiver.mavenarchiver.getmanifest

    原因就是你的maven的配置文件不是最新的 1.help ->Install New Software -> add ->https://otto.takari.io/content ...

  8. {转}理解HTTP/304响应

    源文(英):http://www.telerik.com/blogs/understanding-http-304-responses 中文译文:http://www.cnblogs.com/ziyu ...

  9. 康冕峰IT技术总结博客CSDN索引

    计算1-x内的质数, 结果保存在mysql中. Java 程序员面试笔试宝典 4.1基础知识https://blog.csdn.net/qq_40993412/article/details/1040 ...

  10. SQL基础教程(第2版)第6章 函数、谓词、CASE表达式:6-1 函数

    6-1 各种各样的函数 ● 函数的种类很多,无需全都记住,只需要记住具有代表性的函数就可以了,其他的可以在使用时再进行查询. ■函数的种类所谓函数,就是输入某一值得到相应输出结果的功能,输入值称为参数 ...