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 d1289383eb
commit c540235470
2 changed files with 6 additions and 8 deletions

View File

@@ -13,7 +13,6 @@ import (
"net/http"
"net/http/pprof"
"os"
"path"
"runtime"
"strconv"
"strings"
@@ -607,7 +606,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)
}
}