uwsgi提供更大的静态文件

时间:2013-10-30 19:59:52

标签: django nginx uwsgi

我有一个uwsgi + nginx + django开发设置,并且uwsgi服务较大的静态文件有一点问题,例如。 leaflet.js的大小为120487,导致以下错误:

SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /static/js/lib/leaflet/leaflet.js (ip 125.236.123.123) !!!
uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 296]

这是ini

[uwsgi]
socket = /tmp/%n.sock
master = true
processes = 5
env = DJANGO_SETTINGS_MODULE=abc.settings
module = django.core.handlers.wsgi:WSGIHandler()
pythonpath = /var/www/abc/abc
chdir = /var/www/abc/abc
chmod-socket = 666
uid = www-data
virtualenv = /var/www/abc
vacuum = true
procname-prefix-spaced = %n
cheaper = 1
plugins = python
enable-threads = true
single-interpreter = true
sharedarea = 4

2 个答案:

答案 0 :(得分:0)

愚蠢的我,我在/ var中有文件夹所有权问题,我将所有内容重置为root,因此nginx在/ var / lib / nginx中写入文件的权限错误

chmod -R www-data:www-data /var/lib/nginx

修好了。

答案 1 :(得分:0)

chown -R www-data:www-data /var/lib/nginx