mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
Devenv: Add serve_from_sub_path scenario to nginx devenv (#93691)
Setup serve_from_sub_path scenario with nginx
This commit is contained in:
parent
564ee32b04
commit
59af06e36a
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user