From ee82e01b22963c97401c2deec92179d26bcc9b1f Mon Sep 17 00:00:00 2001 From: Nick Stenning Date: Fri, 27 Jun 2014 12:50:43 +0200 Subject: [PATCH] docker: Explicitly set nginx types_hash_bucket_size As discovered by the inimitable bug-hunter @nigelbabu, on the version of Nginx in the image, the value of types_hash_bucket_size is set at runtime to the processor cache line size. This means that on hardware with small cache lines (16 bytes) the image can fail to start with: nginx: [emerg] could not build the types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 32 This commit sets types_hash_bucket_size and types_hash_max_size to the values used by latest Nginx (1.7.2 at the time of writing). --- contrib/docker/nginx.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contrib/docker/nginx.conf b/contrib/docker/nginx.conf index 298c9dfb12e..73f3c084d72 100644 --- a/contrib/docker/nginx.conf +++ b/contrib/docker/nginx.conf @@ -22,6 +22,14 @@ http { gzip on; gzip_disable "msie6"; + # Unless these are set explicitly, the types_hash_bucket_size is set at + # runtime depending on the processor's cache line size, which can (and does) + # cause inconsistent behaviour on different hardware. Our + # /etc/nginx/mime.types requires at least a 32 bit bucket, but we set these to + # the latest nginx default values to be on the safe size. + types_hash_bucket_size 64; + types_hash_max_size 1024; + proxy_cache_path /var/cache/nginx/proxycache levels=1:2 keys_zone=cache:30m max_size=250m; proxy_temp_path /var/cache/nginx/proxytemp 1 2;