在Nginx中上传大文件时发出,导致502错误网关错误

时间:2020-10-02 11:07:19

标签: django nginx gunicorn

我正在使用Nginx,gunicorn和django框架运行我的Web应用程序,在这里我面临文件上传将存储在db中的问题,我可以上传的最大文件大小是1mb,大约是(5000行),但是,当我上传的内容超过1 mb时,它显示502错误的网关错误,

我的nginx confi文件是:

代码:

  """
             server {     
             listen 80;  
             server_name xxx xxx;  
             client_max_body_size 100M;
             error_log  /var/log/nginx/error.log debug;   
             keepalive_timeout 100;
             location = /favicon.ico { access_log off; log_not_found off; }
             location /static/ { root /home/ubuntu/mainframe;}     
             location /{  
                            include proxy_params;          
                            proxy_pass http://unix:/home/ubuntu/mainframe/mainframe.sock;  

}}
“”“”

我的Gunicorn配置:

        """    
               [Unit] 
                Description=gunicorn daemon
                After=network.target 
               
                [Service] 
                User=ubuntu 
                Group=www-data 
                WorkingDirectory=/home/ubuntu/mainframe 
                ExecStart=/home/ubuntu/.local/bin/gunicorn --access-logfile - --workers 3 --bin unix:/home/ubuntu/mainframe/mainframe.sock mainframe.wsgi:application  
                 
                [Install] 
                WantedBy=multi-user.target    """

任何帮助将不胜感激

2

0 个答案:

没有答案