在我从github上提取了一些更新之后,我的网站目前已关闭。
我已经尝试过sudo systemctl restart gunicorn
和sudo service nginx reload
,但它们无法解决问题。
我已经检查了/var/log/nginx/error.log,内容为:
2019/08/26 17:13:09 [error] 7465#7465: *458 open() "/home/jake/example-main/static/new-leaf-2.png" failed (2: No such file or directory), client: 198.85.222.29, server: 165.22.38.423, request: "GET /static/new-leaf-2.png HTTP/1.1", host: "www.example.com", referrer: "https://www.example.com/"
2019/08/26 17:14:09 [error] 7465#7465: *468 open() "/home/jake/example-main/static/new-leaf-2.png" failed (2: No such file or directory), client: 198.85.222.29, server: 165.22.38.423, request: "GET /static/new-leaf-2.png HTTP/1.1", host: "www.example.com", referrer: "https://www.example.com/items/add-item"
2019/08/26 17:16:09 [notice] 30445#30445: signal process started
2019/08/26 17:17:16 [error] 30449#30449: *475 open() "/home/jake/example-main/static/new-leaf-2.png" failed (2: No such file or directory), client: 198.85.222.29, server: 165.22.38.423, request: "GET /static/new-leaf-2.png HTTP/1.1", host: "www.example.com", referrer: "https://www.example.com/accounts/login"
2019/08/26 17:17:39 [error] 30449#30449: *472 open() "/home/jake/example-main/static/new-leaf-2.png" failed (2: No such file or directory), client: 198.85.222.29, server: 165.22.38.423, request: "GET /static/new-leaf-2.png HTTP/1.1", host: "www.example.com", referrer: "https://www.example.com/accounts/reset-password/"
2019/08/26 17:27:06 [notice] 30600#30600: signal process started
2019/08/26 17:28:10 [notice] 30626#30626: signal process started
2019/08/26 17:36:17 [notice] 30712#30712: signal process started
2019/08/26 17:36:45 [notice] 30744#30744: signal process started
2019/08/26 17:49:44 [notice] 30888#30888: signal process started
这使我认为服务器错误是由于该图像文件在服务器上不可用所致,因此我从主HTML模板中删除了对此文件的请求。
运行sudo nginx -c /etc/nginx/nginx.conf -t
返回:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
为了安全起见,我已将对域的引用更改为“ example”,并更改了服务器IP地址。