uWSGI を使用して NGINX の背後で実行しようとしている pylons アプリがあります。アプリは、httplib を使用して GET 要求を行います。paster でテストすると、アプリは GET リクエストからデータを正常に受信しますが、uWSGI の背後で設定した後、nginx ログに次のエラーが表示されます。
2013/09/20 21:52:07 [error] 3920#0: *10 upstream prematurely closed connection while reading response header from upstream, client: ***, server: ***.com, request: "GET /getElevation?X_Value=-105.61019897460938&Y_Value=40.24959460394122 HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi.maps.sock:"
そしてこれはuwsgiログにあります:
Traceback (most recent call last):
File "/root/.virtualenvs/maps/lib/python2.6/site-packages/Paste-1.7.5.1-py2.6.egg/paste/cascade.py", line 117, in __call__
v = app(environ_copy, repl_start_response)
File "/root/.virtualenvs/maps/lib/python2.6/site-packages/Paste-1.7.5.1-py2.6.egg/paste/urlparser.py", line 446, in __call__
filename = request.path_info_pop(environ)
File "/root/.virtualenvs/maps/lib/python2.6/site-packages/Paste-1.7.5.1-py2.6.egg/paste/request.py", line 309, in path_info_pop
environ['SCRIPT_NAME'] += '/'
KeyError: 'SCRIPT_NAME'
[pid: 3897|app: 0|req: 1/4] **** () {44 vars in 1228 bytes} [Fri Sep 20 21:52:07 2013] GET /getElevation?X_Value=-105.61097145080566&Y_Value=40.24500880734505 => generated 0 bytes in 1 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
...The work of process 3897 is done. Seeya!
worker 2 killed successfully (pid: 3897)
Respawned uWSGI worker 2 (new pid: 3925)
タイムアウトの問題かと思いましたが、uwsgiに以下を設定しました。
socket-timeout = 15
http-timeout = 15
harakiri = 60
uWSGI構成で何かが欠けていると確信しています。誰かが私を正しい方向に向けることができますか?