Quantcast
Channel: Error: request entity too large - Stack Overflow
Viewing all articles
Browse latest Browse all 35

Answer by Promise Preston for Error: request entity too large

$
0
0

To add to Alexander's answer.

By default, NGINX has an upload limit of 1 MB per file. By limiting the file size of uploads, you can prevent some types of Denial-of-service (DOS) attacks and many other issues.

So when you try to upload a file above the 1MB limit you will run into a 413 error.

By editing client_max_body_size, you can adjust the file upload size. Use the http, server, or location block to edit client_max_body_size.

server {  server_name example.com;  location / {    proxy_set_header HOST $host;    proxy_set_header X-Forwarded-Proto $scheme;    proxy_set_header X-Real-IP $remote_addr;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_pass http://127.0.0.1:8080;    client_max_body_size 20M;  }    listen [::]:443 ssl ipv6only=on; # managed by Certbot    listen 443 ssl; # managed by Certbot    ssl_certificate /etc/letsencrypt/live/infohob.com/fullchain.pem; # managed by Certbot    ssl_certificate_key /etc/letsencrypt/live/infohob.com/privkey.pem; # managed by Certbot    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot}

Reference: Limit File Upload Size in NGINX


Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>