From 7cf92e7b2cec59f0994cabe9ef57308e418f73c4 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 5 Jan 2021 17:18:24 -0700 Subject: [PATCH] feature(NGINX): add health stub site --- build/config/health.conf | 16 ++++++++++++++++ build/config/nginx.conf | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 build/config/health.conf diff --git a/build/config/health.conf b/build/config/health.conf new file mode 100644 index 0000000..0b25b97 --- /dev/null +++ b/build/config/health.conf @@ -0,0 +1,16 @@ +# +# nginx health stub-site +# + +server { + listen 80 default_server; + server_name _; + + location /nginx_status { + stub_status; + + # only permit local connections + allow 127.0.0.1; + deny all; + } +} \ No newline at end of file diff --git a/build/config/nginx.conf b/build/config/nginx.conf index 3d3b005..d54d170 100644 --- a/build/config/nginx.conf +++ b/build/config/nginx.conf @@ -14,7 +14,7 @@ include /etc/nginx/modules/*.conf; events { worker_connections 512; multi_accept off; - use epoll; + use epoll; } http { @@ -47,6 +47,9 @@ http { include /etc/nginx/ssl-config/*.conf; include /etc/nginx/config/*.conf; + # include health status stub-site + include /etc/nginx/health.conf; + # include enabled server blocks from sites/*.conf include /etc/nginx/sites/*.conf; -} +} \ No newline at end of file