ситуация
python3 через uwsgi подключен к nginx.
проблема
при попытке послать файл на сервер нет вывода от uWSGI (см. логи ниже), в связи с чем nginx показывает 500 ошибку. а мне как раз нужно как-то организовать upload.
(обычный POST проходит нормально)
логи
nginx
2011/05/30 09:15:22 [error] 3258#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST /upload HTTP/1.1", upstream: "uwsgi://127.0.0.1:3031", host: "localhost", referrer: "http://localhost/"
uwsgi
SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) !!!<br/>
write(): Broken pipe [plugins/python/wsgi_subhandler.c line 128]<br/>
[pid: 3275|app: 0|req: 1/1] 127.0.0.1 () {48 vars in 959 bytes} [Mon May 30 09:14:22 2011] POST /upload => generated 0 bytes in 60000 msecs (HTTP/1.1 200) 3 headers in 92 bytes (0 switches on core 7)
конфиги
nginx
nginx.conf
worker_processes 1;<br/>
<br/>
events {<br/>
worker_connections 1024;<br/>
}<br/>
<br/>
http {<br/>
include uwsgi_params;<br/>
include mime.types;<br/>
default_type application/octet-stream;<br/>
<br/>
log_format main '$remote_addr - $remote_user [$time_local] "$request" '<br/>
'$status $body_bytes_sent "$http_referer" '<br/>
'"$http_user_agent" "$http_x_forwarded_for"';<br/>
<br/>
access_log logs/access.log main;<br/>
<br/>
sendfile on;<br/>
tcp_nopush on;<br/>
<br/>
keepalive_timeout 65;<br/>
<br/>
gzip on;<br/>
<br/>
server {<br/>
listen 80;<br/>
server_name localhost;<br/>
<br/>
charset utf-8;<br/>
<br/>
access_log logs/host.access.log main;<br/>
<br/>
location ~ ^/static/(.+)$ {<br/>
root /home/webknjaz/py/wKSocialNetwork/media/;<br/>
#index index.html index.htm; <br/>
}<br/>
<br/>
location /static {<br/>
root /home/webknjaz/py/wKSocialNetwork/media/static/;<br/>
}<br/>
<br/>
location / {<br/>
uwsgi_pass 127.0.0.1:3031; #/home/webknjaz/py/wsgi.py;<br/>
}<br/>
<br/>
location ~ ^/images/u[0-9]+/(.+\.(?:gif|jpe?g|png))$ {<br/>
root /home/webknjaz/py/wKSocialNetwork/media;<br/>
}<br/>
<br/>
location ~ ^/images/u[0-9]+/+$ {<br/>
root /home/webknjaz/py/wKSocialNetwork/media;<br/>
}<br/>
<br/>
location ~ ^/images/+$ {<br/>
root /home/webknjaz/py/wKSocialNetwork/media;<br/>
}<br/>
<br/>
location ~ /id[0-9]+$ {<br/>
uwsgi_pass 127.0.0.1:3031;<br/>
#root html; #just for testing regex<br/>
}<br/>
location ~ /upload(.*)+ {<br/>
uwsgi_pass 127.0.0.1:3031;<br/>
}<br/>
<br/>
# redirect server error pages to the static page /50x.html<br/>
#<br/>
error_page 500 502 503 504 /50x.html;<br/>
location = /50x.html {<br/>
root html;<br/>
}<br/>
}<br/>
}<br/>
uwsgi_params
uwsgi_param QUERY_STRING $query_string;<br/>
uwsgi_param REQUEST_METHOD $request_method;<br/>
uwsgi_param CONTENT_TYPE $content_type;<br/>
uwsgi_param CONTENT_LENGTH $content_length;<br/>
<br/>
uwsgi_param REQUEST_URI $request_uri;<br/>
uwsgi_param PATH_INFO $document_uri;<br/>
uwsgi_param DOCUMENT_ROOT $document_root;<br/>
uwsgi_param SERVER_PROTOCOL $server_protocol;<br/>
<br/>
uwsgi_param REMOTE_ADDR $remote_addr;<br/>
uwsgi_param REMOTE_PORT $remote_port;<br/>
uwsgi_param SERVER_PORT $server_port;<br/>
uwsgi_param SERVER_NAME $server_name;<br/>
<br/>
#uwsgi_param SCRIPT_NAME $app;<br/>
#uwsgi_param UWSGI_MODULE $app;<br/>
#uwsgi_param UWSGI_CALLABLE "${app}_handler";<br/>
#uwsgi_param UWSGI_PYHOME $document_root;<br/>
#uwsgi_param UWSGI_CHDIR $document_root;<br/>
#uwsgi_modifier1 30; #properly sets PATH_INFO variable<br/>
<br/>
uwsgi_pass_request_body off;<br/>
uwsgi
uwsgi.conf
127.0.0.1:3031<br/>
<enable-threads /><br/>
4<br/>
8<br/>
<master /><br/>
<harakiri-verbose /><br/>
60<br/>
/usr/lib/python3.1/<br/>
/usr/lib/python3.1/site-packages/<br/>
/usr/lib/python3.1/wsgiref/<br/>
/home/webknjaz/py/wKSocialNetwork/<br/>
/home/webknjaz/py/wKSocialNetwork/engine/<br/>
/home/webknjaz/py/wKSocialNetwork/engine/adapter/<br/>
/home/webknjaz/py/wKSocialNetwork/engine/model/<br/>
/home/webknjaz/py/wKSocialNetwork/engine/view/<br/>
/home/webknjaz/py/wKSocialNetwork/logs/uwsgi.log<br/>
<upload-progress>/home/webknjaz/py/wKSocialNetwork/media/upload/progress</upload-progress><br/>
<buffer-size>32768</buffer-size><br/>
<post-buffering>8192</post-buffering><br/>
<post-buffering-bufsize>65536</post-buffering-bufsize><br/>
<limit-post>6553600</limit-post><br/>
<br/>
<br/>
<br/>