prometheus proxy add Header Host
This commit is contained in:
parent
dcee4677ed
commit
b9c674d662
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
|||
|
||||
NOW = $(shell date -u '+%Y%m%d%I%M%S')
|
||||
|
||||
RELEASE_VERSION = 5.2.0
|
||||
RELEASE_VERSION = 5.2.2
|
||||
|
||||
APP = n9e
|
||||
SERVER_BIN = $(APP)
|
||||
|
|
|
@ -79,7 +79,7 @@ services:
|
|||
- "server"
|
||||
|
||||
nwebapi:
|
||||
image: ulric2019/nightingale:5.1.0
|
||||
image: ulric2019/nightingale:5.2.1
|
||||
container_name: nwebapi
|
||||
hostname: nwebapi
|
||||
restart: always
|
||||
|
@ -107,7 +107,7 @@ services:
|
|||
- "webapi"
|
||||
|
||||
nserver:
|
||||
image: ulric2019/nightingale:5.1.0
|
||||
image: ulric2019/nightingale:5.2.1
|
||||
container_name: nserver
|
||||
hostname: nserver
|
||||
restart: always
|
||||
|
|
|
@ -36,6 +36,8 @@ func prometheusProxy(c *gin.Context) {
|
|||
req.URL.Scheme = target.Scheme
|
||||
req.URL.Host = target.Host
|
||||
|
||||
req.Header.Set("Host", target.Host)
|
||||
|
||||
// fe request e.g. /api/n9e/prometheus/api/v1/query
|
||||
index := strings.Index(req.URL.Path, "/prometheus")
|
||||
if index == -1 {
|
||||
|
|
Loading…
Reference in New Issue