app: use relative paths instead of absolute paths for the supported http handlers on the main page

This allows hiding VictoriaMetrics components behind proxies, which serve pages at different path prefixes

See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1858
This commit is contained in:
Aliaksandr Valialkin
2021-12-02 13:51:49 +02:00
parent 03f5ad3060
commit 90c542af12
3 changed files with 15 additions and 17 deletions

View File

@@ -13,7 +13,6 @@ import (
"net/http"
"net/http/pprof"
"os"
"path"
"runtime"
"strconv"
"strings"
@@ -637,7 +636,6 @@ func GetPathPrefix() string {
func WriteAPIHelp(w io.Writer, pathList [][2]string) {
for _, p := range pathList {
p, doc := p[0], p[1]
p = path.Join(*pathPrefix, p)
fmt.Fprintf(w, "<a href=%q>%s</a> - %s<br/>", p, p, doc)
}
}