Skip to content

Commit

Permalink
Merge pull request prometheus#2755 from brancz/redirect-prefix
Browse files Browse the repository at this point in the history
prefix redirect with external url path
  • Loading branch information
fabxc authored May 24, 2017
2 parents 5405a47 + ad22606 commit 09fcbf7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"sort"
"strings"
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 09fcbf7

Please sign in to comment.