Devenv: Add serve_from_sub_path scenario to nginx devenv (#93691)

Setup serve_from_sub_path scenario with nginx
This commit is contained in:
Misi 2024-09-24 19:53:29 +02:00 committed by GitHub
parent 564ee32b04
commit 59af06e36a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}
}