I want to access grafana with nginx reverse proxy which is on different server.
Here are the changes in grafana.ini
;root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = true
nginx.conf
location ^~ /grafana {
#rewrite ^/grafana/(.*)$ /$1 break;
proxy_pass http://*.*.*.*:3000;
proxy_http_version 1.1;
proxy_set_header Connection 'upgrade';
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Authorization "";
proxy_max_temp_file_size 0;
}
grafana.log
logger=context userId=0 orgId=0 uname= t=2023-01-16T11:14:43.002626662Z level=info msg="Request Completed" method=GET path=/grafana status=302 remote_addr=157.45.195.57 time_ms=0 duration=409.347µs size=29 referer= handler=notfound
if i am setting the location in nginx.conf to / without subpath i am able to access it. but with /grafana getting this error in grafan.log