nginx 启动错误"nginx: [emerg] host not found in upstream "解决方案
2014-04-11 14:27
2121 查看
问题描述:
利用nginx进行反向代理的时候,我们会配置proxy_pass。在启动nginx的时候,会报
nginx: [emerg] host not found in upstream "yq.object.com" in /usr/local/nginx/conf/vhost/yq.nginx.com.conf:19 这个错误。
其实nginx配置语法上没有错误的,只是系统无法解析这个域名,所以报错.
解决办法就是添加dns到/etc/resolv.conf 或者是/etc/hosts,让其能够解析到IP。具体步骤如下:
vim /etc/hosts
修改hosts文件,在hosts文件里面加上一句
127.0.0.1 localhost.localdomain yq.object.com
其实 这和windows下的hosts文件的修改是一样的。具体可以去了解一下hosts的作用
server { listen 80; server_name yq.object.home.com; charset utf-8; access_log /www/logs/yq.object.home.log; location / { proxy_set_header Host yq.object.com; proxy_set_header DFROM 'yq.object.home.com'; proxy_pass http://yq.object.com:8080/object/home.php; } }
利用nginx进行反向代理的时候,我们会配置proxy_pass。在启动nginx的时候,会报
nginx: [emerg] host not found in upstream "yq.object.com" in /usr/local/nginx/conf/vhost/yq.nginx.com.conf:19 这个错误。
其实nginx配置语法上没有错误的,只是系统无法解析这个域名,所以报错.
解决办法就是添加dns到/etc/resolv.conf 或者是/etc/hosts,让其能够解析到IP。具体步骤如下:
vim /etc/hosts
修改hosts文件,在hosts文件里面加上一句
127.0.0.1 localhost.localdomain yq.object.com
其实 这和windows下的hosts文件的修改是一样的。具体可以去了解一下hosts的作用
相关文章推荐
- 服务器部署_nginx的host not found in upstream "tomcat_www.bojinne" 错误解决办法
- nginx host not found in upstream "jewelry.360nk.com" in /etc/nginx/conf:94
- Nginx 提示host not found in upstream 错误解决方法
- 启动hive报错:("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- grub 启动错误 "file not found"
- "Procedure EntryPoint XXX Not Found In WS2_32.dll"的解决方案
- 启动错误:Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
- nginx could not be resolved (3: Host not found)错误解决方案
- nginx: [emerg] "server" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:48
- Docker容器启动lnmp环境下的mysql服务时报"MySQL server PID file could not be found"错误解决办法
- Hive学习2_错误: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- "Python version x.x required, which was not found in the registry"解决方案
- mac上安装nginx启动报错:nginx: [emerg] invalid event type "epoll" in /usr/local/nginx/conf/nginx.conf:1
- 解决错误:nginx: [emerg] unknown log format "main" in
- 启动MyEclipse出现"Source not found for JdbcOdbcDriver.finalize() line: not available"解决
- springboot 启动错误 出现Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.Level
- nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) 错误
- Exception: "dot" not found in path.
- Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法
- tomcat启动报错“The processing instruction target matching "[xX][mM][lL]" is not allowed.”解决方案