Reputation: 2570
I'm using the Angular app as a frontend and Django rest framework for backend service and Gunicorn application server to interface with my application and Nginx to reverse proxy to Gunicorn to its security and performance features to serve my app.
There is one request for uploading the file to the server and it fails when the file is large (about 100mb) and the internet is slow and everything is fine with small files (under 10mb).
Here are errors that I get
net::ERR_TIMED_OUT
net::ERR_HTTP2_PING_FAILED
net::ERR_CONNECTION_RESET
Here is my Nginx config:
location ~ ^(/upload_video/[^/]+) {
keepalive_timeout 128;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
client_max_body_size 100M;
proxy_pass http://unix:/run/gunicorn.sock;
}
And here is my Gunicorn service:
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=ubuntu
Group=www-data
WorkingDirectory=/home/ubuntu/rest_api
ExecStart=/home/ubuntu/hediehchi_rest_api/myenv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--timeout 180 \
--bind unix:/run/gunicorn.sock \
webapp.wsgi:application
[Install]
WantedBy=multi-user.target
What's the problem? comment below if any information needs to be added.
Upvotes: 6
Views: 5789
Reputation:
If you want to upload 100MB, you need a client_max_body_size
this is somewhat larger. Second the timeout you're looking for is client_body_timeout
.
Upvotes: 3