Grafana behind AWS ALB

  • I have grafana running on an EC2 instance on port 3000
  • I created a target group called grafana-tg that redirects traffic to the target instances on port 3000
  • Configured an ALB with the rule: if path matches /grafana then forward to the target group grafana-tg (also tried /grafana/ but still no dice)
  • the root_url config in grafana.ini: root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
  • I can see the traffic hitting the grafana service but I'm getting this error message: msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/grafana/ status=404 remote_addr=x.x.x.x time_ms=1 size=22164 referer=

I assume your Grafana is on EC2:3000/ and not on EC2:3000/grafana/ correct?

However you’re redirecting from ALB:/grafana/ to EC2:3000/grafana/

  • either fix the redirect to go from ALB:/grafana/ to EC2:3000/
  • or change Grafana setup to listen at EC2:3000/grafana/

Hope that helps :)


My solution was to put the url of my Grafana server on line 49 of /etc/grafana/grafana.ini :

  • root_url = https://grafana.mydomain.com