简体   繁体   English

Grafana - 使用 IIS 和 URL 重写作为反向代理

[英]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.我希望 Grafana 成为 IIS 中网站下的子路径或子文件夹,添加 ssl 证书,使用 https。

I've checked this tutorial: https://grafana.com/tutorials/iis/我检查了本教程: https://grafana.com/tutorials/iis/

defaults.ini默认值.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自定义.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.http://localhost:8080/ds我得到连接被拒绝。 So this port is not used by any running application.所以这个端口不被任何正在运行的应用程序使用。

On http://localhost:3000/ I get this:http://localhost:3000/我得到这个:

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: IIS URL 重写设置: 在此处输入图像描述

According to https://grafana.com/tutorials/run-grafana-behind-a-proxy/#1根据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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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