If you’re getting 413 Request Entity Too Large errors trying to upload files to your webserver, you need to increase the client body size limit in your nginx.conf configuration file.
Add ‘client_max_body_size xxM’ inside the server section, where xx is the size (in MB) that you want to allow for files upload to your webserver.
The client_max_body_size directive assigns the maximum accepted body size of client request, indicated by the line Content-Length in the header of request.
To edit your nginx configuration, in your terminal type the following:
sudo nano /etc/nginx/nginx.conf or sudo nano /usr/local/nginx/conf/nginx.conf and set the # set client body size to 2M # client_max_body_size 2M;
as per the example below:
http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { client_max_body_size 2M; listen 80; server_name localhost; # Main location location / { proxy_pass http://127.0.0.1:8000/; } } }