- 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=
Asked
Active
Viewed 2,119 times
3
![](../../users/profiles/37828.webp)
FrancisV
- 1,726
- 3
- 15
- 18
2 Answers
1
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
![](../../users/profiles/708143.webp)
Paco Garcia
- 11
- 1
1
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 :)
![](../../users/profiles/122588.webp)
MLu
- 23,798
- 5
- 54
- 81
-
Yes, you're correct. Grafana is listening on port 3000 on the EC2 instance. Apparently, ALB passes the parameter to the target group. I think I might have to configure an nginx reverse proxy on the EC2 instance itself. – FrancisV Nov 26 '18 at 06:49
-
1@FrancisV IMO it would be much easier to simply move Grafana to `EC2:3000/grafana/` rather than adding a Nginx to the mix. I’m quite sure there must be a way to set such prefix. – MLu Nov 26 '18 at 09:10
-
1How? Can't seem to find any documentation that describes this. – FrancisV Nov 26 '18 at 09:24