django+;nginx+;uwsgi,文件浏览器未上载

django+;nginx+;uwsgi,文件浏览器未上载,django,nginx,uwsgi,django-filebrowser,Django,Nginx,Uwsgi,Django Filebrowser,我已经将django站点从apache+wsgi转换为nginx+uwsgi。除了使用filebrowser上传文件外,其他一切似乎都正常工作。这确实适用于apache+wsgi,因此我假设这是nginx或uwsgi中的配置问题 我看到的问题是上传没有返回错误,但文件没有写入磁盘 流量由前端nginx实例代理到我的nginx实例 我的nginx.conf worker_processes 4; events { worker_connections 1024; } http {

我已经将django站点从apache+wsgi转换为nginx+uwsgi。除了使用filebrowser上传文件外,其他一切似乎都正常工作。这确实适用于apache+wsgi,因此我假设这是nginx或uwsgi中的配置问题

我看到的问题是上传没有返回错误,但文件没有写入磁盘

流量由前端nginx实例代理到我的nginx实例

我的nginx.conf

worker_processes  4;

events {
    worker_connections  1024;
}

http {
    access_log  /home/username/logs/user/access_nginx_uwsgi.log combined;
    error_log   /home/username/logs/user/error_nginx_uwsgi.log  crit;

    include mime.types;
    sendfile on;

    set_real_ip_from   127.0.0.1;
    real_ip_header     X-Forwarded-For;

    include /home/username/webserver/nginx/*.conf;

}
我的虚拟主机配置是

server {
    listen 127.0.0.1:26293;
    server_name domainname.com;

    access_log  /home/username/logs/user/access_tdebt.log combined;
    error_log   /home/username/logs/user/error_tdebt.log  crit;

    location /static/ {
        alias /home/username/.virtualenvs/tdebt/tdebt/site_static/;
        expires 7d;
    }

    location /media/ {
        alias /home/username/.virtualenvs/tdebt/tdebt/site_media/;
        expires 7d;
    }
    location / {
        include uwsgi_params;
        uwsgi_pass unix:///home/username/webserver/sock/tdebt.sock;
    }
}
uwsgi配置

[uwsgi]
chdir = /home/username/.virtualenvs/tdebt
home=/home/username/.virtualenvs/tdebt
wsgi-file = /home/username/.virtualenvs/tdebt/tdebt/webserver_config/wsgi.py
env = DJANGO_SETTINGS_MODULE=tdebt.settings
master = true
pidfile = /home/username/webserver/pid/tdebt.pid
socket = /home/username/webserver/sock/tdebt.sock
processes = 2
threads = 30
enable-threads = true
harakiri = 120
vacuum = true
reload-on-rss = 30
log-x-forwarded-for = true
idle = 300
procname-master = [username-tdebt] uWSGI Master
procname = [username-tdebt] uWSGI Worker
logto = /home/username/webserver/logs/tdebt_uwsgi.log
logdate = true
感谢您的帮助。如果有任何其他信息可能会有所帮助,请让我知道

更新:

问题似乎在于django filebrowser和uwsgi,因为可以使用Apache/mod_uwsgi复制该问题

更新:


问题在于我使用的django文件浏览器的fork。由于某些原因,无法与uwsgi一起使用。

Nginx有一个
客户端\u max\u body\u size
指令,该指令限制可以发送的HTTP body的大小。它的默认值是1兆,因此您应该添加
客户机\u max\u body\u size=20m
或类似的值。您不会收到错误,因为大多数浏览器不会替换413错误


谢谢您的回复。我应该提到,我试图上传的文件大小只有14K左右,所以即使是默认的1MB也应该足够了。无论如何,我都会尝试一下。