我很难排除这个错误 .
我将尝试尽可能好地概述上下文,在我的问题结束时,我将提供所有配置文件的内容 .
我正在使用gunicorn启动我的Flask应用程序,Ngninx处理代理proxy_pass .
如果我手动运行 gunicorn run:app --log-level=debug --log-file=/tmp/test_gunicorn65.log
,则在访问http://my_pretty_dns时会提供应用程序
同时,如果我试图通过supervisor运行gunicorn,服务器会抛出500内部服务器错误
我的nginx conf:
server {
server_name test.something.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
我的主管conf:
[program:something]
command = /home/ubuntu/work/repos/something/gunicorn_start_project
directory = /home/ubuntu/work/repos/something
stdout_logfile=/var/log/supervisor/supervisor_stdout.log
stderr_logfile=/var/log/supervisor/supervisor_stderr.log
user = ubuntu
gunicorn_start_project的内容:
#!/bin/bash
exec venv/bin/gunicorn run:app --log-level=debug --log-file=/tmp/test_gunicorn65.log
tl; dr:当手动从CLI手动启动gunicorn时,不确定为什么应用程序被服务,当由supervisor供电时,它会抛出“内部服务器错误” .