Merge "grafana: proxy websockets"

This commit is contained in:
Zuul 2022-03-15 20:10:40 +00:00 committed by Gerrit Code Review
commit 8a0a0040e3
2 changed files with 10 additions and 0 deletions

View File

@ -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'

View File

@ -1,5 +1,7 @@
<VirtualHost *:80>
ServerName {{ inventory_hostname }}
ServerAlias grafana.opendev.org
ServerAdmin webmaster@openstack.org
ErrorLog ${APACHE_LOG_DIR}/grafana-error.log
@ -14,6 +16,8 @@
<VirtualHost *:443>
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/