diff --git a/playbooks/roles/grafana/templates/docker-compose.yaml.j2 b/playbooks/roles/grafana/templates/docker-compose.yaml.j2 index d02f564756..e9b7405f60 100644 --- a/playbooks/roles/grafana/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/grafana/templates/docker-compose.yaml.j2 @@ -8,6 +8,7 @@ services: image: docker.io/grafana/grafana-oss:latest network_mode: host environment: + GF_SERVER_DOMAIN: 'grafana.opendev.org' GF_SECURITY_ADMIN_PASSWORD__FILE: '/etc/grafana/secrets/admin_password' GF_SECURITY_ADMIN_USER__FILE: '/etc/grafana/secrets/admin_user' GF_SECURITY_SECRET_KEY__FILE: '/etc/grafana/secrets/secret_key' diff --git a/playbooks/roles/grafana/templates/grafana.vhost.j2 b/playbooks/roles/grafana/templates/grafana.vhost.j2 index 07a5caf3ce..c20ee11249 100644 --- a/playbooks/roles/grafana/templates/grafana.vhost.j2 +++ b/playbooks/roles/grafana/templates/grafana.vhost.j2 @@ -1,5 +1,7 @@ ServerName {{ inventory_hostname }} + ServerAlias grafana.opendev.org + ServerAdmin webmaster@openstack.org ErrorLog ${APACHE_LOG_DIR}/grafana-error.log @@ -14,6 +16,8 @@ ServerName {{ inventory_hostname }} + ServerAlias grafana.opendev.org + ServerAdmin webmaster@openstack.org AllowEncodedSlashes On @@ -44,6 +48,11 @@ RewriteEngine on RewriteRule "^/api/snapshots(.*?)$" "-" [F] + # This is for the websocket endpoint /api/live/ws + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] + RewriteRule ^/?(.*) "ws://localhost:3000/$1" [P,L] + ProxyPass / http://localhost:3000/ retry=0 ProxyPassReverse / http://localhost:3000/