DaCrow13 commited on
Commit
385d201
·
1 Parent(s): 7f15bfd

fix(docker): switch Grafana to root serving with nginx path stripping

Browse files
docker/nginx.conf CHANGED
@@ -79,8 +79,8 @@ http {
79
  }
80
 
81
  location /grafana/ {
82
- # Do NOT strip the path. explicit serve_from_sub_path=true in Grafana needs the prefix.
83
- proxy_pass http://127.0.0.1:3000;
84
  proxy_set_header Host $host;
85
  proxy_set_header X-Real-IP $remote_addr;
86
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
79
  }
80
 
81
  location /grafana/ {
82
+ # Strip the path. Grafana will be configured with serve_from_sub_path=false
83
+ proxy_pass http://127.0.0.1:3000/;
84
  proxy_set_header Host $host;
85
  proxy_set_header X-Real-IP $remote_addr;
86
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
docker/scripts/start_space.sh CHANGED
@@ -102,7 +102,7 @@ grafana-server --homepath=/usr/share/grafana \
102
  cfg:default.paths.logs=/tmp/grafana_logs \
103
  cfg:default.paths.plugins=/usr/share/grafana/plugins \
104
  cfg:server.root_url="$GRAFANA_ROOT_URL" \
105
- cfg:server.serve_from_sub_path=true \
106
  >> /tmp/grafana.log 2>&1 &
107
 
108
  # Wait for Grafana to start
@@ -110,6 +110,9 @@ echo "$(date) - Waiting for Grafana (20s)..."
110
  for i in {1..20}; do
111
  if curl -s http://127.0.0.1:3000/api/health > /dev/null; then
112
  echo "$(date) - Grafana is UP!"
 
 
 
113
  break
114
  fi
115
  sleep 1
 
102
  cfg:default.paths.logs=/tmp/grafana_logs \
103
  cfg:default.paths.plugins=/usr/share/grafana/plugins \
104
  cfg:server.root_url="$GRAFANA_ROOT_URL" \
105
+ cfg:server.serve_from_sub_path=false \
106
  >> /tmp/grafana.log 2>&1 &
107
 
108
  # Wait for Grafana to start
 
110
  for i in {1..20}; do
111
  if curl -s http://127.0.0.1:3000/api/health > /dev/null; then
112
  echo "$(date) - Grafana is UP!"
113
+ # Debug: Check what Grafana responds at root
114
+ echo "$(date) - VERIFYING GRAFANA ROOT RESPONSE:"
115
+ curl -v http://127.0.0.1:3000/ 2>&1 | head -n 20
116
  break
117
  fi
118
  sleep 1