-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
discussion 💬The right solution needs to be foundThe right solution needs to be foundfeature ⚙️New feature or requestNew feature or request
Milestone
Description
Very often the desired functionality of a webserver configuration is clear. When a user accesses the URL 1, she should get the file X from /var/foo. The URL 2 is proxies to the backend URL 3 and headers Y and Z are added.
Correctly configuring the webserver is more challenging. As a non-expert in caddy, one has to try multiple configurations and debug the proxy backend requests.
Can we add a configuration directive assert request_matcher response_matcher
(using matchers)? Those assertions would be checked after parsing/loading the configuration. Some vague examples:
example.com {
root /var/foo
reverse_proxy /api/* localhost:9005 {
header_up Foo "Bar"
}
assert https://example.com/cat.jpg file:/var/foo/cat.jpg
assert https://example.com/does-not-exist { status_code 404 }
assert https://example.com/api/ping { reverse_proxy http://localhost:9005/ping; header Foo "Bar" }
}
What you you think?
Thanks!
lclc
Metadata
Metadata
Assignees
Labels
discussion 💬The right solution needs to be foundThe right solution needs to be foundfeature ⚙️New feature or requestNew feature or request