![尝试查看我的网站时出现 Nginx 错误 502 Http 错误](https://linux22.com/image/745375/%E5%B0%9D%E8%AF%95%E6%9F%A5%E7%9C%8B%E6%88%91%E7%9A%84%E7%BD%91%E7%AB%99%E6%97%B6%E5%87%BA%E7%8E%B0%20Nginx%20%E9%94%99%E8%AF%AF%20502%20Http%20%E9%94%99%E8%AF%AF.png)
当我在浏览器中查看时,website.com
无法正确加载并出现 HTTP 502 错误。当我查看以下日志时:/var/log/nginx/error.log
我得到:
2019/11/22 18:32:34 [error] 1761#1761: *25 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: website.com, request: "GET / HTTP/1.0", upstream: "uwsgi://127.0.0.1:8001"
我当前的 nginx 配置website
如下:
# the upstream component nginx needs to connect to
upstream django {
server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name website.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 2M; # adjust to taste
# Django media
#location /media {
# alias ; # your Django project's media files - amend as required
#}
location /static {
alias /var/www/website/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /var/www/website/uwsgi_params; # the uwsgi_params file you installed
}
}
这里出了什么问题?