错误的信息为:
nginx: [emerg] "upstream" directive is not allowed here
这里的原因是改了配置文件upstream存的的位置不对所以导致报错的。
需要把 upstream 放入http 里面保存重启nginx就解决了。