forked from praxis-proxy/praxis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredirect.yaml
More file actions
37 lines (33 loc) · 961 Bytes
/
Copy pathredirect.yaml
File metadata and controls
37 lines (33 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Redirect
#
# Returns a 3xx redirect without contacting any upstream.
# Useful for scheme upgrades (HTTP to HTTPS), domain
# migrations, or path reorganization.
#
# The location template supports ${path} and ${query}
# placeholders from the original request URI.
#
# Usage:
# cargo run -p praxis-proxy -- -c examples/configs/traffic-management/redirect.yaml
# curl -v http://localhost:8080/some/path?q=1
# curl -v http://localhost:8081/docs/guide?lang=en
listeners:
- name: https_upgrade
address: "127.0.0.1:8080"
filter_chains:
- https_upgrade
- name: domain_migration
address: "127.0.0.1:8081"
filter_chains:
- domain_migration
filter_chains:
- name: https_upgrade
filters:
- filter: redirect
status: 301
location: "https://example.com${path}"
- name: domain_migration
filters:
- filter: redirect
status: 308
location: "https://new.example.com${path}${query}"