-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First Request Path Demo #24
Comments
One thing to think about is how we shape this in our config. Right now, our config for basic proxy looks like this (psuedo rust): BasicProxy {
name: String,
listeners: Vec<Listener>, // upstream(s)
connector: Connector, // downstream
} One question is: Are certain rules, like matching/filtering/routing, specified as PART of the basic proxy config? e.g. as a field in the basic proxy struct, or do we specify rules externally, using something like the "name" field to match which proxy to use? For example, NGINX has some level of scoping, but separates named For example:
(example from https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/) This specifies:
In contrast, {
"apps": {
"http": {
"servers": {
"hello": {
"listen": [":443"],
"routes": [
{
"match": [{
"host": ["example.com"]
}],
"handle": [{
"handler": "static_response",
"body": "Hello, privacy!"
}]
}
]
}
}
}
}
} Shows the nesting of:
Zooming in to just apps::http looks like https://caddyserver.com/docs/json/apps/http/ |
Concerning the configuration structure: The pseudo-rust you provide looks like there would be a mapping of n listeners to 1 Connector. From what I understand, a connector is an abstraction representing a pool of connections to a single backend server which in reality can consist of redundant but identical servers. In your nginx example the choice of different backends is based on the path, not the listener. The same is true for the Caddy example, there is no direct mapping from Listener to the backend. This is also how Apache httpd handles it. Then, there is also the notion of SNI and virtual hosts where the SNI information and host headers, as well as the port number, might be taken into account in the choice of backend. In Apache httpd it is further possible to choose the backend based on other criteria than the host header or request location. For example, using mod_rewrite, it is possible to choose the backend based on complex expressions, leveraging regular expressions and environment variables. This is probably quite an advanced use-case and not relevant for an initial version but might be worth keeping in mind.
In Apache httpd this would give something along the lines of:
The naming the configuration |
Hey @studersi, thanks for the info! A couple points: WRT Additionally, yes, at the moment only a single upstream/server/connector is allowed in BasicProxy, largely as I haven't designed any way to specify pooling, load balancing, etc. In |
Thanks for the clarification. I'll be looking forward to how it turns out :-) |
This is a brainstorming issue for tracking which demo(s) to prioritize for the Kickstart milestone.
request_filter
), as well as a bit of path->upstream routing (inupstream_peer
)The text was updated successfully, but these errors were encountered: