'Request Entity Too Large' error when uploading an attachment due to NGINX proxy server

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Users report that a file upload fails depending on its size.  The following error appears when trying to upload a file:


413 Request Entity Too Large
nginx/x.x.x

Symptoms

A 'Request Entity Too Large' error appears when uploading an attachment. The Confluence attachment max upload size is configured to a size larger than the attachment trying to be uploaded.

Cause

Ngix does not allow attachment size upload larger than the one trying to be uploaded.

Resolution

Increase the size limit in nginx.conf. Include client_max_body_size xxM inside the server section, where xx is the size (in megabytes) that you want to allow.

For example:

 http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        client_max_body_size 10M;
        listen       80;
        server_name  localhost;

        # Main location
        location / {
            proxy_pass         http://127.0.0.1:8000/;
        }
    }
}

Last modified on Jan 28, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.