Path Matching Settings
This reference covers all of Pomerium's Path Matching Settings:
Path
If Path is set, the route will only match incoming requests with a path that is an exact match for the specified path.
How to configure
- Core
- Enterprise
- Kubernetes
YAML/JSON setting | Type | Usage |
---|---|---|
path | string | optional |
Set Path under Path Matching settings in the Console:
See Kubernetes Ingress for more information
Examples
routes:
- from: https://verify.localhost.pomerium.io
to: http://verify:8000
path: /admin/some/exact/path
Prefix
If Prefix is set, the route will only match incoming requests with a path that begins with the specified prefix.
How to configure
- Core
- Enterprise
- Kubernetes
YAML/JSON setting | Type | Usage |
---|---|---|
prefix | string | optional |
Set the Prefix in Path Matching settings:
Name | Type | Usage |
---|---|---|
Prefix | string | optional |
See Kubernetes Ingress for more information
Examples
from: https://from.example.com
to: https://to.example.com
prefix: /admin
# ingress
spec:
ingressClassName: pomerium
rules:
- host: example.localhost.pomerium.io
http:
paths:
- backend:
service:
name: example
port:
name: http
path: /
pathType: Prefix
Regex
If Regex is set, the route will only match incoming requests with a path that matches the specified regular expression. The supported syntax is the same as the Go regexp package which is based on re2.
How to configure
- Core
- Enterprise
- Kubernetes
YAML/JSON setting | Type | Usage |
---|---|---|
regex | string | optional |
Set Regex in the Console:
Name | Type | Usage |
---|---|---|
path_regex | string | optional |
Examples
regex: "^/(admin|superuser)/.*$"
# ingress
ingress.pomerium.io/path_regex: 'true'
name: example
spec:
ingressClassName: pomerium
rules:
- host: example.localhost.pomerium.io
http:
paths:
- backend:
service:
name: example
port:
name: http
path: ^/(admin|superuser)/.*$
pathType: ImplementationSpecific