好的,所以我在Digital Ocean上有一个Droplet,Ubuntu在Nginx实例下有2个Ghost博客。
一个是在gabsferreira.com和panddi.com上的其他人。
出于某种原因,gabsferreira.com在网上几个小时后停机,给我这个错误:
502 Bad Gateway
nginx/1.4.6 (Ubuntu)
如果我查看Nginx日志,我会得到多行这样的内容:
2017/05/01 23:46:18 [error] 928#0: *14500 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.79.174, server: gabsferreira.com, request: "GET /robots.txt HTTP/1.1", upstream: "http://127.0.0.1:2368/robots.txt", host: "gabsferreira.com"
2017/05/01 23:47:06 [error] 928#0: *14502 connect() failed (111: Connection refused) while connecting to upstream, client: 177.74.125.151, server: gabsferreira.com, request: "GET /criando-e-enviando-arquivos-para-seu-repositorio-no-github/ HTTP/1.1", upstream: "http://127.0.0.1:2368/criando-e-enviando-arquivos-para-seu-repositorio-no-github/", host: "gabsferreira.com", referrer: "https://www.google.com.br/"
2017/05/01 23:47:07 [error] 928#0: *14502 connect() failed (111: Connection refused) while connecting to upstream, client: 177.74.125.151, server: gabsferreira.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2368/favicon.ico", host: "gabsferreira.com", referrer: "http://gabsferreira.com/criando-e-enviando-arquivos-para-seu-repositorio-no-github/"
如果我重新启动机器,它会再次开始工作,但几个小时后就会停机。
在所有这些期间,其他博客保持在线状态,所以Nginx和Ghost正在运行。
在我的网站启用的Nginx文件夹中,每个博客都有两个配置,panddi.conf:
server {
server_name blog.panddi.com www.blog.panddi.com;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 10G;
location / {
proxy_pass http://localhost:2777;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
和gabs.conf:
server {
#listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
#listen 127.0.0.1:2368;
server_name gabsferreira.com;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 10G;
location / {
proxy_pass http://localhost:2368;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
我不知道发生了什么以及为什么它只停留了几个小时。
感谢。