【发布时间】:2014-11-01 00:34:04
【问题描述】:
前言:我正在使用 s3boto 作为默认存储后端的亚马逊 ec2 实例上运行 nginx + gunicorn + django。我是免费层。 ec2 安全组允许:http、ssh 和 https。
我正在尝试发送包含单个元素的多部分/表单数据请求:照片。尝试上传照片时,iPhone(请求的来源)挂起。照片大小约为 9.5 MB。
当我检查 nginx-access.logs 时:
"POST /myUrl/ HTTP/1.1" 400 5 "-""....
当我检查 nginx-error.logs 时:
[error] 5562#0: *1 readv() failed (104: Connection reset by peer) while reading upstream, client: my.ip.addr.iphone, server: default, request: "POST /myUrl/ HTTP/1.1", upstream: "http://127.0.0.1:8000/myUrl/", host: "ec2-my-server-ip-addr.the-location-2.compute.amazonaws.com"
[info] 5562#0: *1 client my.ip.addr.iphone closed keepalive connection
我真的不知道为什么会这样...我尝试更改 /etc/nginx/sites-available/default 超时设置...
server { ...
client_max_body_size 20M;
client_body_buffer_size 20M;
location / {
keepalive_timeout 300;
proxy_read_timeout 300;
}
}
有什么想法吗?
【问题讨论】:
标签: django amazon-web-services nginx amazon-ec2 gunicorn