diff --git a/devenv/docker/blocks/auth/nginx_proxy/nginx_serve_from_sub_path.conf b/devenv/docker/blocks/auth/nginx_proxy/nginx_serve_from_sub_path.conf new file mode 100644 index 00000000000..5da5207657b --- /dev/null +++ b/devenv/docker/blocks/auth/nginx_proxy/nginx_serve_from_sub_path.conf @@ -0,0 +1,39 @@ +events { worker_connections 1024; } + +http { + # This is required to proxy Grafana Live WebSocket connections. + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + upstream grafana { + server host.docker.internal:3000; + } + + server { + listen 8090; + + location / { + root /var/www/html; + } + + # Set the followings in grafana.ini: + # [server] + # root_url = http://localhost:8090/grafana/ + # serve_from_sub_path = true + location /grafana/ { + proxy_set_header Host $host; + proxy_pass http://grafana; + } + + # Proxy Grafana Live WebSocket connections. + location /grafana/api/live/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_pass http://grafana; + } + } +} \ No newline at end of file