Skip to main content

URL Configuration

info

When running Gate in proxy mode, you can configure target URLs for redirection. In ext_auth and aws_lambda_auth mode, the target value is ignored.

Defining URL mapping

You can map request URLs to specific target URLs. Paths are matched in order of insertion.

GATE_URLS_0_PATTERN=svc-example.com/*
GATE_URLS_0_TARGET=http://example:8080

GATE_URLS_1_PATTERN=svc-another-example.com/
GATE_URLS_1_TARGET=https://another-example:8080

When configuring Gate through environment variables, the URL number defines the order in which URLs are matched. In the example above, the GATE_URLS_0 URL will be matched first, and the GATE_URLS_1 URL will be matched second.

When using configuration files (any format), URLs are matched in the order in which they are specified in the configuration file.

If the request URL does not match with any of the defined paths, the default target URL is used.

Default target URL

You can define the default target URL for Gate, which will be called if no mapped URL is matched.

GATE_DEFAULT_TARGET=http://default-svc:8080

Pattern format

You can specify static paths as pattern, and use wildcards with *.

A few examples:

PatternRequestMatchesComment
example.localhost/fooexample.localhost/foo
example.localhost/*example.localhost/foo
example.localhost/*example.localhost/foo/bar
*/fooexample.localhost/foo
*.example.localhost/foofoo.example.localhost/foo
other.localhost/fooexample.localhost/fooDomain is different
other.localhost/fooexample.localhost/fooDomain is different
example.localhost:8080/fooexample.localhost/fooPort is different
example.localhost:*/fooexample.localhost:8899/foo
example.localhost/fooexample.localhost/
example.localhost/foo/*/barexample.localhost/foo/foo_id/bar
example.localhost/foo/*example.localhost/foo/foo_id/bar/bar_id
example.localhost/foo/example.localhost/foo/?foo=barQuery parameters are not required in the pattern