From 10cf64982372cf9a4ac7d747e28f5ebacd78b6fc Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Fri, 8 Dec 2017 14:03:53 -0800 Subject: [PATCH] nginx.conf: Use equal values for client_body_buffer_size and client_max_body_size to avoid writing big files to disk Idea taken from https://medium.com/urban-massage-product/nginx-with-docker-easier-said-than-done-d1b5815d00d0 after noticing a user pushing a big layer causing out of space errors writing to /var/cache/nginx. Change-Type: patch Signed-off-by: Pablo Carranza Velez --- nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx.conf b/nginx.conf index d7e4340..2a2e5d3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -43,6 +43,10 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Add to x-forward-for proxy_read_timeout 900; proxy_buffering off; + # These two should be the same or nginx will start writing + # large request bodies to temp files + client_body_buffer_size 10m; + client_max_body_size 10m; upstream docker-registry { server localhost:5000;