【发布时间】:2018-08-05 14:16:35
【问题描述】:
我正在关注来自数字海洋How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04的本教程
一切正常,除了当我尝试使用 gmail 发送电子邮件时,它会抛出 502 bad gateway。 nginx日志文件显示
94 上游从上游读取响应头时过早关闭连接
gunicorn 配置
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=webuser
Group=www-data
WorkingDirectory=/home/webuser/chhuti_ata
ExecStart=/home/webuser/venv/chhuti/bin/gunicorn --access-logfile - --
workers 3 --bind unix:/home/webuser/chhuti_ata/chhuti.sock
chhuti.wsgi:application
[Install]
WantedBy=multi-user.target
nginx 配置
server {
listen 80;
server_name ***.***.***.***;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/webuser/chhuti_ata;
}
location /media/ {
root /home/webuser/chhuti_ata;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/webuser/chhuti_ata/chhuti.sock;
}
}
任何帮助将不胜感激。
【问题讨论】:
-
请添加配置文件
-
您现在可以检查一下吗