From 45502497df037e8a145ae8dc92c0b4ef378c537c Mon Sep 17 00:00:00 2001 From: Shubhendu Tripathi Date: Wed, 28 May 2014 16:30:51 +0530 Subject: nagios-server-addons: Redirect http to https for nagios Enabled redirecting nagios and pnp4nagios urls to https Change-Id: I3d1e62438c7265aca6cd930f37fd4aac08d83f76 Signed-off-by: Shubhendu Tripathi Reviewed-on: http://review.gluster.org/7906 Reviewed-by: Bala FA Reviewed-by: Timothy Asir --- nagios-server-addons.spec.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nagios-server-addons.spec.in b/nagios-server-addons.spec.in index fd07977..6836bdc 100644 --- a/nagios-server-addons.spec.in +++ b/nagios-server-addons.spec.in @@ -135,6 +135,17 @@ elif grep -q "process_performance_data=0" $NagiosCFGFile ; then sed -i -e 's/enable_environment_macros=0/enable_environment_macros=1/g' $NagiosCFGFile fi +NagiosConfFile=/etc/httpd/conf.d/nagios.conf +if grep -q "#.*SSLRequireSSL" $NagiosConfFile; then + sed -i -e 's/#.*SSLRequireSSL/ SSLRequireSSL/g' $NagiosConfFile +fi + +cat > /etc/httpd/conf.d/glusternagios.conf << EOF +RewriteEngine On +RewriteCond %{HTTPS} off +RewriteRule ^/nagios|^/pnp4nagios https://%{HTTP_HOST}%{REQUEST_URI} +EOF + if ! grep -q "#rhs performance monitoring" $NagiosCFGFile; then cat >> $NagiosCFGFile <