【发布时间】:2018-05-30 19:26:08
【问题描述】:
我是 Python 新手。我托管了 Flask 应用程序,它将在 EC2 实例上的 Nginx 服务器上接受 Gunicorn 的 POST 请求。
当我在路线上发帖时,我收到以下错误:
1578#0: *14 upstream prematurely closed connection while reading response header from upstream, client: myip, server: serverip, request: "POST /train HTTP/1.1", upstream: "http://unix:/home/ec2-user/myproject/myproject.sock:/save_data", host: "serverip"
POST 请求不是来自同一个域,并且总是来自其他域。我需要在我的 nginx.conf 文件中添加一些内容吗?
当我使用命令 python app.py 运行应用程序时,一切正常
【问题讨论】:
标签: python nginx flask gunicorn