Nexus "413 Request Entity Too Large" on upload in CI
A 413 comes from a reverse proxy in front of Nexus, not Nexus itself. The upload exceeds the proxy body size limit (nginx client_max_body_size), so it is rejected before reaching Nexus. Raise the limit for large jars and Docker layers.
What this error means
A large Maven artifact or Docker layer push fails with "413 Request Entity Too Large", while smaller uploads to the same Nexus succeed.
# nginx front end response
HTTP/1.1 413 Request Entity Too Large
# docker push
failed to push: received unexpected HTTP status: 413 Request Entity Too LargeCommon causes
nginx client_max_body_size too small
The default nginx body limit (1m) is far below multi-MB jars or Docker layers, so the proxy rejects the upload with 413.
A load balancer or WAF request size cap
An intermediary load balancer or WAF caps request bodies below the artifact size and returns 413.
How to fix it
Raise the proxy body size limit
- Increase
client_max_body_sizein the nginx server/location fronting Nexus. - Reload nginx.
- Re-run the upload or docker push.
# nginx site config for Nexus
location / {
proxy_pass http://nexus_upstream;
client_max_body_size 5G;
}Raise limits on any intermediate LB/WAF
If a cloud load balancer or WAF sits in front, increase its maximum request body size to match your largest artifacts and Docker layers.
How to prevent it
- Set the reverse-proxy body limit above your largest artifact/layer.
- Account for Docker layer sizes, not just jar sizes.
- Test a large push after any proxy change.