'Request Entity Too Large' error when uploading an attachment due to NGINX proxy server
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Users report that a file upload fails depending on its size. The following error appears when trying to upload a file:
1
2
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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/;
}
}
}
Was this helpful?