diff options
author | Shubhendu Tripathi <shtripat@redhat.com> | 2014-05-28 16:30:51 +0530 |
---|---|---|
committer | Timothy Asir <tim.gluster@gmail.com> | 2014-05-29 02:52:20 -0700 |
commit | 45502497df037e8a145ae8dc92c0b4ef378c537c (patch) | |
tree | 025f1877a4ac80e5bbc71082aa9ba975d0dbf92c /nagios-server-addons.spec.in | |
parent | eb64fd4b46d334ddfda60a815e1655cb72bf68a2 (diff) |
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 <shtripat@redhat.com>
Reviewed-on: http://review.gluster.org/7906
Reviewed-by: Bala FA <barumuga@redhat.com>
Reviewed-by: Timothy Asir <tim.gluster@gmail.com>
Diffstat (limited to 'nagios-server-addons.spec.in')
-rw-r--r-- | nagios-server-addons.spec.in | 11 |
1 files changed, 11 insertions, 0 deletions
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 <<EOF #rhs performance monitoring |