Merge pull request #2755 from brancz/redirect-prefix
prefix redirect with external url path
This commit is contained in:
commit
09fcbf78df
|
@ -23,6 +23,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -170,7 +171,7 @@ func New(o *Options) *Handler {
|
||||||
instrf := prometheus.InstrumentHandlerFunc
|
instrf := prometheus.InstrumentHandlerFunc
|
||||||
|
|
||||||
router.Get("/", func(w http.ResponseWriter, r *http.Request) {
|
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))
|
router.Get("/alerts", instrf("alerts", h.alerts))
|
||||||
|
|
Loading…
Reference in New Issue