docs: clarify alpha upstream path syntax (#3504)

Signed-off-by: nightcityblade <nightcityblade@gmail.com>
Co-authored-by: nightcityblade <nightcityblade@gmail.com>
This commit is contained in:
nightcityblade
2026-08-20 07:32:33 +02:00
committed by GitHub
co-authored by nightcityblade
parent f7ae0ae81e
commit d122f0c28e
2 changed files with 8 additions and 6 deletions
+7 -5
View File
@@ -62,12 +62,14 @@ type Upstream struct {
// Path is used to map requests to the upstream server.
// The closest match will take precedence and all Paths must be unique.
// Path can also take a pattern when used with RewriteTarget.
// Path segments can be captured and matched using regular experessions.
// Without RewriteTarget, Path follows gorilla/mux route syntax.
// Eg:
// - `^/foo$`: Match only the explicit path `/foo`
// - `^/bar/$`: Match any path prefixed with `/bar/`
// - `^/baz/(.*)$`: Match any path prefixed with `/baz` and capture the remaining path for use with RewriteTarget
// - `/foo`: Match only the explicit path `/foo`
// - `/bar/`: Match any path prefixed with `/bar/`
// - `/baz/{path:.*}`: Match any path prefixed with `/baz/`
// When RewriteTarget is set, Path is treated as a regular expression.
// Eg: `^/baz/(.*)$` matches any path prefixed with `/baz` and captures the
// remaining path for use with RewriteTarget.
Path string `yaml:"path,omitempty"`
// RewriteTarget allows users to rewrite the request path before it is sent to