From 1255923bcc147a27c089c508b8816501ae54c88c Mon Sep 17 00:00:00 2001
From: Mitesh Shah <Mitesh.Shah@rtcamp.com>
Date: Wed, 7 Aug 2013 18:34:31 +0530
Subject: [PATCH] Status Pages

---
 etc/nginx/common/allowed_ip.conf |  3 +++
 etc/nginx/common/locations.conf  | 14 +++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 etc/nginx/common/allowed_ip.conf

diff --git a/etc/nginx/common/allowed_ip.conf b/etc/nginx/common/allowed_ip.conf
new file mode 100644
index 00000000..087c9bae
--- /dev/null
+++ b/etc/nginx/common/allowed_ip.conf
@@ -0,0 +1,3 @@
+# Allowd IP Address
+allow 127.0.0.1;
+deny all;
\ No newline at end of file
diff --git a/etc/nginx/common/locations.conf b/etc/nginx/common/locations.conf
index 80ebe633..8f248169 100644
--- a/etc/nginx/common/locations.conf
+++ b/etc/nginx/common/locations.conf
@@ -47,6 +47,18 @@ location /pma {
 		rewrite ^/* /phpmyadmin last;
 }
 
+# Status Pages
+location /nginx_status {
+        stub_status on;
+        access_log   off;
+        include common/allowed_ip.conf;
+}
+
+location ~ ^/(status|ping) {
+        include fastcgi_params;
+        fastcgi_pass php;
+        include common/allowed_ip.conf;
+}
 
 # Security Settings For Better Privacy
 
@@ -75,4 +87,4 @@ location /wp-content/uploads/ {
 		#Prevent Direct Access Of PHP Files From Web Browsers
 		deny all;
 	}
-}
+}
\ No newline at end of file