From 3e4392dc998403f29f7be7cf23b0385b37a52837 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Mon, 18 Feb 2019 11:13:55 -0800 Subject: [PATCH 1/3] Fail if any of the healthchecks failed --- bin/docker-entrypoint.sh | 1 - bin/docker-healthcheck.sh | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/docker-entrypoint.sh b/bin/docker-entrypoint.sh index a78b159..c9fa275 100755 --- a/bin/docker-entrypoint.sh +++ b/bin/docker-entrypoint.sh @@ -11,7 +11,6 @@ echo_debug () if [[ "$DEBUG" != 0 ]]; then echo -e "$(date +"%F %H:%M:%S") | $@"; fi } - # Execute available init scripts # This can be used by child images to run additional provisioning scripts at startup ls /etc/docker-entrypoint.d/ > /dev/null diff --git a/bin/docker-healthcheck.sh b/bin/docker-healthcheck.sh index 88903af..8e6195c 100755 --- a/bin/docker-healthcheck.sh +++ b/bin/docker-healthcheck.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Fail if any of the healthchecks failed +set -e + # Verify nginx config is valid nginx -t From a46c0ef54a3e4eb00e19d1d132141cacf19884dc Mon Sep 17 00:00:00 2001 From: Sergey Zabolotny Date: Fri, 25 Oct 2019 11:49:05 +0300 Subject: [PATCH 2/3] Change health check method --- bin/docker-healthcheck.sh | 4 ++-- conf/includes/defaults.conf.tmpl | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/docker-healthcheck.sh b/bin/docker-healthcheck.sh index 8e6195c..8d1ebc9 100755 --- a/bin/docker-healthcheck.sh +++ b/bin/docker-healthcheck.sh @@ -6,5 +6,5 @@ set -e # Verify nginx config is valid nginx -t -# Verify default vhost it up -wget -qSO- http://127.0.0.1/.healthz +# Check if nginx started and listening tcp port +netstat -nlp | grep -E 'tcp.*LISTEN.*nginx' >/dev/null || exit 1 diff --git a/conf/includes/defaults.conf.tmpl b/conf/includes/defaults.conf.tmpl index c5acf02..989cbc7 100644 --- a/conf/includes/defaults.conf.tmpl +++ b/conf/includes/defaults.conf.tmpl @@ -1,7 +1,2 @@ # Shared default virtual host settings go here -# /.healthz location for status checks -location ~ ^/\.healthz$ { - access_log off; - return 204; -} From 83b3b709f9e4318e41961289203fd03ae7cc8574 Mon Sep 17 00:00:00 2001 From: Sergey Zabolotny Date: Fri, 25 Oct 2019 13:12:55 +0300 Subject: [PATCH 3/3] Change default nginx settings --- conf/nginx.conf.tmpl | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf.tmpl b/conf/nginx.conf.tmpl index 180edfb..273f2c4 100644 --- a/conf/nginx.conf.tmpl +++ b/conf/nginx.conf.tmpl @@ -19,8 +19,31 @@ http { access_log /var/log/nginx/access.log main; - sendfile on; - keepalive_timeout 65; + proxy_connect_timeout 60; + proxy_send_timeout 600; + proxy_read_timeout 600; + proxy_intercept_errors on; + proxy_cache off; + proxy_request_buffering off; + proxy_buffering off; + proxy_buffers 16 32k; + proxy_buffer_size 32k; + proxy_http_version 1.1; + proxy_set_header Connection ""; + + client_max_body_size 1G; + http2_max_field_size 8k; + + port_in_redirect off; + send_timeout 600; + sendfile on; + keepalive_requests 100; + keepalive_timeout 60; + reset_timedout_connection off; + server_tokens off; + + server_names_hash_bucket_size 128; + server_names_hash_max_size 20480; include /etc/nginx/conf.d/*.conf; }