1. The problem I’m having:
As a preface - I understand handle_errors
must be a top-level directive for a site; my goal here is help in figuring out how I can rework this logic such that it’ll still work ideally without the need for handle_errors
.
My issue is I have quite large single-sites configurations (say, 2000+ lines long) in order to achieve something like:
https://rpc.lavenderfive.com:443/osmosis
https://rpc.lavenderfive.com:443/cosmoshub
https://rpc.lavenderfive.com:443/axelar
...
For 100+ different endpoints, which results in a configuration like:
rpc.lavenderfive.com {
log
import blocked
import rpc-header
handle_path /osmosis* {
reverse_proxy 5.0.4.3:12517 {
import lb-config 12517
@old_block status 400 404 503 502
handle_response @old_block {
reverse_proxy 5.0.4.2:12517 5.0.4.8:12517 5.0.4.9:12517 {
import lb-config 12517
}
}
}
}
(Note that this is quite simplified for the sake of brevity).
Now, if we say 5.0.4.3:12517
is down, all of the upstreams are considered down despite there being 4 total. What I’d like to do as an ideal case is the following:
rpc.lavenderfive.com {
log
import blocked
import rpc-header
handle_path /osmosis* {
reverse_proxy 5.0.4.3:12517 {
import lb-config 12517
@old_block status 400 404 503 502
handle_response @old_block {
reverse_proxy 5.0.4.2:12517 5.0.4.8:12517 5.0.4.9:12517 {
import lb-config 12517
}
}
}
handle_errors {
reverse_proxy 5.0.4.2:12517 5.0.4.8:12517 5.0.4.9:12517 {
import lb-config 12517
}
}
}
However, this cannot be done. Instead, I understand the following does work:
rpc.lavenderfive.com {
log
import blocked
import rpc-header
handle_path /osmosis* {
reverse_proxy 5.0.4.3:12517 {
import lb-config 12517
@old_block status 400 404 503 502
handle_response @old_block {
reverse_proxy 5.0.4.2:12517 5.0.4.8:12517 5.0.4.9:12517 {
import lb-config 12517
}
}
}
}
handle_errors {
handle_path /osmosis* {
reverse_proxy 5.0.4.2:12517 5.0.4.8:12517 5.0.4.9:12517 {
import lb-config 12517
}
}
}
}
Is there a way to achieve something closer to the “ideal” case?