Skip to content

Commit

Permalink
nginx.conf: Use equal values for client_body_buffer_size and client_m…
Browse files Browse the repository at this point in the history
…ax_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 <[email protected]>
  • Loading branch information
Pablo Carranza Velez committed Dec 8, 2017
1 parent af26543 commit 10cf649
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 10cf649

Please sign in to comment.