解决办法来自于: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. hdu 4300 Clairewd’s message 字符串哈希

    Clairewd’s message Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  2. linux命令之strace简单使用

    strace是什么 strace是一个可用于诊断.调试和教学的Linux用户空间跟踪器.我们用它来监控用户空间进程和内核的交互,比如系统调用.信号传递.进程状态变更等. 使用方式 strace 使用帮 ...

  3. XSS跨站脚本攻击与CSRF跨站请求伪造攻击的学习总结(转载)

    转载自 https://blog.csdn.net/baidu_24024601/article/details/51957270 之前就了解过这方面的知识,但是没有系统地总结.今天在这总结一下,也让 ...

  4. B. The Number of Products(Codeforces Round #585 (Div. 2))

    本题地址: https://codeforces.com/contest/1215/problem/B 本场比赛A题题解:https://www.cnblogs.com/liyexin/p/11535 ...

  5. EUI库 - 容器

      eui.UILayer UILayer是Group的子类它只有一个功能,到放到场景上后,宽高永远和场景宽度一致   Group Group 是自动布局的容器基类.如果包含的子项内容太大需要滚动显示 ...

  6. Dynamics CRM - 解决无法使用 Ribbon Workbench 2016 定制 Sub-Grid View Button 的问题(SubGrid MainTab 消失之谜)

    发现问题: 在 Dynamics CRM 开发中,会经常使用 Ribbon Workbench 工具来定制 Button 或者对已有 Button 进行自定义功能开发,比如隐藏 SubGrid 的 A ...

  7. MySQL授权用户登录访问指定数据库

    使用Navicat等客户端工具,选中需要共享的数据库,点击查询>新建查询 1.写SQL语句:GRANT ALL PRIVILEGES ON * TO 'test'@'%'IDENTIFIED B ...

  8. 1.6判断类型toString.call()

    之前我都是使用typeof,后来发现它的判断有局限,例如(){}obeject.p.toString.call()解决了 obj.toString()的结果和Object.prototype.toSt ...

  9. linux 下shell 编写脚本

    linux 下shell 编写脚本: 1.程序结构练习:编写一个脚本,给定一个正整数,计算出这个数所有位的数字之和. 例如:程序给定输入123,那么应该返回1+2+3=6. 2.程序结构练习:编写一个 ...

  10. jenkins+saltstack+pipeline 部署springcloud 多模块jar包

    在jenkins上安装salt-master, pipeline{ agent{       node{               label 'master'               cust ...