问题: nginx: [emerg] host not found in upstream “xxx.nginx.com” in xxx/conf/nginx.conf:xx
解决: 修改 C:\Windows\System32\drivers\etc\hosts
文件,在最后一行加上如下代码重启Nginx即可
127.0.0.1 localhost.localdomain xxx.nginx.com
xxx.nginx.com 是自己 Nginx 配置的 server_name 的值
Tips:
1、重启Nginx(这条 cmd 命令要在 nginx 的安装目录下执行)
nginx.exe -s reload
2、注意查看任务管理器(Windows)中 Nginx 的进程数量,多个 Nginx 进程可能引起一些奇怪的错误。