From 1056e8a9837f4fb94eee5e29080b786986042c2b Mon Sep 17 00:00:00 2001 From: SolidNerd Date: Wed, 29 Jun 2016 18:39:44 +0200 Subject: [PATCH] Add NGINX_SERVER_NAMES_HASH_BUCKET_SIZE --- README.md | 1 + assets/runtime/env-defaults | 1 + assets/runtime/functions | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a9fd873..ac1c6b73 100644 --- a/README.md +++ b/README.md @@ -844,6 +844,7 @@ Below is the complete list of available options that can be used to customize yo - **SSL_REGISTRY_CERT_PATH**: Location of the ssl certificate for the gitlab container registy. Defaults to `/home/git/data/certs/registry.crt` - **SSL_CIPHERS**: List of supported SSL ciphers: Defaults to `ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4` - **NGINX_WORKERS**: The number of nginx workers to start. Defaults to `1`. +- **NGINX_SERVER_NAMES_HASH_BUCKET_SIZE**: Sets the bucket size for the server names hash tables. This is needed when you have long server_names or your an error message from nginx like *nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size:..*. It should be only increment by a power of 2. Defaults to `32`. - **NGINX_HSTS_ENABLED**: Advanced configuration option for turning off the HSTS configuration. Applicable only when SSL is in use. Defaults to `true`. See [#138](https://github.com/sameersbn/docker-gitlab/issues/138) for use case scenario. - **NGINX_HSTS_MAXAGE**: Advanced configuration option for setting the HSTS max-age in the gitlab nginx vHost configuration. Applicable only when SSL is in use. Defaults to `31536000`. - **NGINX_PROXY_BUFFERING**: Enable `proxy_buffering`. Defaults to `off`. diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 02911b67..48ec5259 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -155,6 +155,7 @@ AWS_BACKUP_BUCKET=${AWS_BACKUP_BUCKET} AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ## NGINX +NGINX_SERVER_NAMES_HASH_BUCKET_SIZE=${NGINX_SERVER_NAMES_HASH_BUCKET_SIZE:-32}; NGINX_WORKERS=${NGINX_WORKERS:-1} NGINX_ACCEL_BUFFERING=${NGINX_ACCEL_BUFFERING:-no} NGINX_PROXY_BUFFERING=${NGINX_PROXY_BUFFERING:-off} diff --git a/assets/runtime/functions b/assets/runtime/functions index 123a0ceb..d9f8a0db 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -1245,7 +1245,11 @@ configure_gitlab_shell() { configure_nginx() { echo "Configuring nginx..." - sed -i "s|worker_processes .*|worker_processes ${NGINX_WORKERS};|" /etc/nginx/nginx.conf + sed -i \ + -e "s|worker_processes .*|worker_processes ${NGINX_WORKERS};|" \ + -e "s|# server_names_hash_bucket_size 64;|server_names_hash_bucket_size ${NGINX_SERVER_NAMES_HASH_BUCKET_SIZE};|" \ + /etc/nginx/nginx.conf + nginx_configure_gitlab nginx_configure_gitlab_ci nginx_configure_gitlab_registry