web: prefix redirect with ExternalURL path

This commit is contained in:
Frederic Branczyk 2017-05-22 14:15:02 +02:00
parent 45df5c2daf
commit ad22606a3d
No known key found for this signature in database
GPG key ID: CA14788B1E48B256

View file

@ -23,6 +23,7 @@ import (
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"sort"
"strings"
@ -170,7 +171,7 @@ func New(o *Options) *Handler {
instrf := prometheus.InstrumentHandlerFunc
router.Get("/", func(w http.ResponseWriter, r *http.Request) {
router.Redirect(w, r, "/graph", http.StatusFound)
router.Redirect(w, r, path.Join(o.ExternalURL.Path, "/graph"), http.StatusFound)
})
router.Get("/alerts", instrf("alerts", h.alerts))