解决办法来自于: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. 苏州大学ICPC集训队新生赛第二场

    A - Score UVA - 1585 水 #include<bits/stdc++.h> using namespace std; int main(){ int n; cin> ...

  2. UVA - 10791 Minimum Sum LCM(最小公倍数的最小和)

    题意:输入整数n(1<=n<231),求至少两个正整数,使得它们的最小公倍数为n,且这些整数的和最小.输出最小的和. 分析: 1.将n分解为a1p1*a2p2……,每个aipi作为一个单独 ...

  3. Ganglia 安装 No package 'ck' found

    安装ConcurrecyKit,下载地址:https://github.com/concurrencykit/ck   编译安装即可 下面是一个歪果仁的解决办法,不过我没用上 I was buildi ...

  4. ABP which was not registered.

    ABP 错误: 'AoLongData.Finances.FinanceService' is waiting for the following dependencies:- Service 'Ab ...

  5. Docker部署NETCORE应用程序

    Docker部署NETCORE应用程序 创建.netcore项目,本文以ASP.NET Core2.2 版本为例 设置Dockerfile属性始终复制 编辑Dockerfile内容 FROM micr ...

  6. Codeforces 446C 线段树 递推Fibonacci公式

    聪哥推荐的题目 区间修改和区间查询,但是此题新颖之处就在于他的区间修改不是个定值,而是从L 到 R 分别加 F1.F2....Fr-l+1 (F为斐波那契数列) 想了一下之后,觉得用fib的前缀和来解 ...

  7. spring boot输入数据校验(validation)

    Spring Boot 集成教程 Spring Boot 介绍 Spring Boot 开发环境搭建(Eclipse) Spring Boot Hello World (restful接口)例子 sp ...

  8. Mac下使用Hexo搭建个人博客

    Hexo介绍 利用原作者的一句话:A fast,simple&powerful blog framework,powered by Node.js Hexo是基于Node.js的博客平台,He ...

  9. outlook 2013邮件在服务器保留副本

    用outlook2013来收邮件确实是比较方便,但是它收邮件默认设置是:当outlook2013将在线邮箱的邮件下载至本机计算机之后,它就会删除在线邮箱中的邮件.不知道是不是以前邮箱容量比较小,所以要 ...

  10. swoole怎么连接数据库

    异步连接到MySQL服务器. $serverConfig为MySQL服务器的配置,必须为关联索引数组 $callback连接完成后回调此函数 swoole连接数据库实例: 推荐学习:swoole教程 ...