I setup the registry v2
and use nginx
as reverse proxy. When I push the image to registy, it error out 413 Request Entity Too Large
.
I have modify the client_max_body_size as 20MB in nginx.conf. The push still fails.
client_max_body_size 20M;
What is the body size in docker push? How can I limit the body size?
What does “413 Request Entity Too Large” mean? A 413 HTTP error code occurs when the size of a client's request exceeds the server's file size limit. This typically happens when a client attempts to upload a large file to a web server, and the server responds with a 413 error to alert the client.
Error: 413 “Request Entity Too Large” in Nginx with “client_max_body_size” / Changes in Nginx config file. This is happening because of your nginx server not allow to upload file which is larger than defined size in nginx config file.To solve it , you have to modify your nginx configuration.
Fixing Error “413 Request Entity Too Large” in Nginx This restrictive limitation is the cause of the “413 Request Entity Too Large” error. To avoid this, you can simply set the client_max_body_size option to a larger value. To accomplish this, you have to edit the /etc/nginx/nginx. conf file.
Docker documentation mentions the limit should be turned off:
http {
...
# disable any limits to avoid HTTP 413 for large image uploads
client_max_body_size 0;
...
}
For anyone getting this error in Kubernetes you need to add this annotation to the registry Ingress resource:
nginx.ingress.kubernetes.io/proxy-body-size: "0"
You should increase the available memory to 300 MB with:
client_max_body_size 300M;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With