From a932bada6bcdc51e29023d55fbc81e0f6b4a8d7c Mon Sep 17 00:00:00 2001 From: "Ernest W. Durbin III" Date: Thu, 28 Nov 2013 09:07:41 -0500 Subject: [PATCH] add nginx stub_status for internal network, fall back to localhost --- .../salt/nginx/config/{nginx.conf => nginx.conf.jinja} | 9 +++++++++ provisioning/salt/roots/salt/nginx/init.sls | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) rename provisioning/salt/roots/salt/nginx/config/{nginx.conf => nginx.conf.jinja} (70%) diff --git a/provisioning/salt/roots/salt/nginx/config/nginx.conf b/provisioning/salt/roots/salt/nginx/config/nginx.conf.jinja similarity index 70% rename from provisioning/salt/roots/salt/nginx/config/nginx.conf rename to provisioning/salt/roots/salt/nginx/config/nginx.conf.jinja index d2cb863..f634f0f 100644 --- a/provisioning/salt/roots/salt/nginx/config/nginx.conf +++ b/provisioning/salt/roots/salt/nginx/config/nginx.conf.jinja @@ -22,4 +22,13 @@ http { include /etc/nginx/conf.d/*.conf; + server { + listen 80 default; + location /nginx_status { + stub_status on; + access_log off; + allow {{ salt['pillar.get']('pypi_internal_network', '127.0.0.1') }}; + deny all; + } + } } diff --git a/provisioning/salt/roots/salt/nginx/init.sls b/provisioning/salt/roots/salt/nginx/init.sls index 47ff981..e9e00cf 100644 --- a/provisioning/salt/roots/salt/nginx/init.sls +++ b/provisioning/salt/roots/salt/nginx/init.sls @@ -26,7 +26,8 @@ nginx: /etc/nginx/nginx.conf: file.managed: - - source: salt://nginx/config/nginx.conf + - source: salt://nginx/config/nginx.conf.jinja + - template: jinja - user: root - group: root - mode: 644