简体   繁体   中英

Grafana - Use IIS with URL Rewrite as a Reverse Proxy

I want Grafana to be a subpath or subfolder under a website in IIS, add a ssl certificate, use https.

I've checked this tutorial: https://grafana.com/tutorials/iis/

defaults.ini

# The http port to use
http_port = 3000

# The public facing domain name used to access grafana from a browser
domain = localhost

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
enforce_domain = false

# The full public facing url
root_url = %(protocol)s://%(domain)s:%(http_port)s/

custom.ini

# The http port  to use
;http_port = 8080

# The public facing domain name used to access grafana from a browser
domain = localhost:8080

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = %(protocol)s://%(domain)s:%(http_port)s/ds/
root_url = %(protocol)s://%(domain)s/ds/

On http://localhost:8080/ds I get connection refused. So this port is not used by any running application.

On http://localhost:3000/ I get this:

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

在此处输入图像描述

IIS URL Rewrite Settings: 在此处输入图像描述

According to https://grafana.com/tutorials/run-grafana-behind-a-proxy/#1

[server]
domain = example.com
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
serve_from_sub_path = true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM