Https reverse proxy in nginx

Hi, I am trying to put grafana behind nginx though reverse proxy. It works for http but I want to use https. Below is my config in nginx and grafana.ini

location /grafana/ {
    proxy_pass http://grafana.staged-by-discourse.com/
}
[server]
root_url = https://my.domain/grafana/
serve_from_sub_path = true

http://my.domain/grafana works but https://my.domain/grafana give me the following message.

If you're seeing this Grafana has failed to load its application files

1. This could be caused by your reverse proxy settings.

2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath. If not using a reverse proxy make sure to set serve_from_sub_path to true.

3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build

4. Sometimes restarting grafana-server can help

5. Check if you are using a non-supported browser. For more information, refer to the list of supported browsers.

Hello :wave: and welcome to the forum, @brokentv

how are you handling your TLS setup for https?

I would encourage you to search this forum for nginx + subpath issues. The settings and configuration can get tricky. IMHO it is much easier to serve grafana on a subdomain like grafana.my.domain rather than a sub path

I am not sure what you mean by TLS setup for https. I have ssl_protocols TLSv1.2; in my nginx.conf.

It is tricky based on the time I’ve spent on this. I will try subdomain and see if it works.