forked from Deuxfleurs/tricot
Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
3b19439f9a | |||
8c7f974e06 | |||
2a679f97b6 | |||
|
e89f3b67bd | ||
7540b03cf6 |
2 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ Tricot uses the following environment variables for its configuration (they can
|
|||
|
||||
Backends are configured by adding tags of the following form to the services in Consul:
|
||||
|
||||
- `tricot myapp.example.com`: indicates that Tricot should get a TLS certificate for domain myapp.example.com and route traffic for this domain to this service
|
||||
- `tricot myapp.example.com`: indicates that Tricot should get a TLS certificate for domain myapp.example.com and route traffic for this domain to this service. Also supports glob patterns (for instance, `tricot *` redirects requests for all domains).
|
||||
- `tricot myapp.example.com 10`: same but with a priority of 10. This is lower than the default priority value of 100, so Tricot will only use this rule if no higher-priority services are available.
|
||||
- `tricot myapp.example.com/path/to_subresource`: same but indicates that only requests whose paths start with `/path/to/subresource` should be routed to this service
|
||||
- `tricot myapp.example.com/path/to_subresource 10`: combining the previous two examples
|
||||
|
|
|
@ -371,8 +371,8 @@ async fn do_proxy(
|
|||
reverse_proxy::call(remote_addr.ip(), &to_addr, req).await?
|
||||
};
|
||||
|
||||
if response.status().is_success() {
|
||||
// (TODO: maybe we want to add these headers even if it's not a success?)
|
||||
if response.status().is_success() || response.status().is_redirection() {
|
||||
// (TODO: maybe we want to add these headers even if it's not a success or redirection?)
|
||||
for (header, value) in proxy_to.add_headers.iter() {
|
||||
response.headers_mut().insert(
|
||||
HeaderName::from_bytes(header.as_bytes())?,
|
||||
|
|
Loading…
Add table
Reference in a new issue