You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cmd/promxy/main.go
+6-2
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,7 @@ type cliOpts struct {
90
90
ProxyHeaders []string`long:"proxy-headers" env:"PROXY_HEADERS" description:"a list of headers to proxy to downstream servergroups."`
91
91
92
92
ExternalURLstring`long:"web.external-url" description:"The URL under which Prometheus is externally reachable (for example, if Prometheus is served via a reverse proxy). Used for generating relative and absolute links back to Prometheus itself. If the URL has a path portion, it will be used to prefix all HTTP endpoints served by Prometheus. If omitted, relevant URL components will be derived automatically."`
93
+
RoutePrefixstring`long:"web.route-prefix" description:"Prefix for the internal routes of web endpoints. Defaults to path of --web.external-url."`
93
94
EnableLifecyclebool`long:"web.enable-lifecycle" description:"Enable shutdown and reload via HTTP request."`
94
95
95
96
QueryTimeout time.Duration`long:"query.timeout" description:"Maximum time a query may take before being aborted." default:"2m"`
@@ -389,7 +390,7 @@ func main() {
389
390
EnableLifecycle: opts.EnableLifecycle,
390
391
391
392
Flags: opts.ToFlags(),
392
-
RoutePrefix: "/",
393
+
RoutePrefix: opts.RoutePrefix,
393
394
ExternalURL: externalUrl,
394
395
Version: &web.PrometheusVersion{
395
396
Version: version.Version,
@@ -406,9 +407,12 @@ func main() {
406
407
logrus.Fatalf("Error parsing CORS regex: %v", err)
407
408
}
408
409
409
-
ifexternalUrl!=nil&&externalUrl.Path!="" {
410
+
// Default -web.route-prefix to path of -web.external-url.
0 commit comments