From 3b5874081600b6ad5aa3196cbddc60c16c9a6fef Mon Sep 17 00:00:00 2001 From: MOHANKUMAR T <31698165+mohan-13@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:00:02 +0530 Subject: [PATCH] BAH-3149 | Add proxy pass rule for Grafana (#10) * BAH-3149 | Add proxy pass rule for grafana * BAH-3149 | Fix. Add Rewrite rule in the right place --- resources/bahmni-proxy.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/bahmni-proxy.conf b/resources/bahmni-proxy.conf index 7cbf149..b7836b6 100644 --- a/resources/bahmni-proxy.conf +++ b/resources/bahmni-proxy.conf @@ -73,8 +73,9 @@ ProxyPass /metabase http://metabase:3000 ProxyPassReverse /metabase http://metabase:3000 #Grafana -ProxyPass /grafana ws://grafana:3000 -ProxyPassReverse /grafana ws://grafana:3000 +ProxyPass /grafana ws://grafana:3000/grafana +ProxyPassReverse /grafana ws://grafana:3000/grafana + #SMS Service ProxyPass /sms-service http://sms-service:8080 @@ -158,6 +159,13 @@ Listen 443 SSLCertificateFile "/etc/tls/cert.pem" SSLCertificateKeyFile "/etc/tls/key.pem" + RewriteEngine on + RewriteCond %{REQUEST_URI} ^/grafana/api/* + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] + Header set Content-Security-Policy upgrade-insecure-requests + RewriteRule ^/?(.*) "ws://grafana:3000/$1" [P,L] + RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC]