I currently have something hardcoded like so: reverse_proxy https://****.com
.
Is there a way I can pass it info from my API, and then use it to dynamically set the reverse_proxy?
Thanks.
I currently have something hardcoded like so: reverse_proxy https://****.com
.
Is there a way I can pass it info from my API, and then use it to dynamically set the reverse_proxy?
Thanks.
Could you be more specific about how youâd pass in the info? This is a bit lacking on detail. What heuristics do you expect to use to populate it?
There is some work being done to improve the reverse_proxy
module to support dynamic upstreams, which might allow you to do what you need, but what you want to might already be possible, depending on your requirements.
My apologies. So what Iâm trying to achieve: The main goal is to issue and SSL and cloak a domain.
Not sure if that makes sense? But we want to dynamically set the reverse_proxy thatâs sent from our API.
Thanks.
What do you want the request to your API to contain? How do you want to make the decision of what upstream address to return? Is it based on the request path? Based on the hostname? Do you really need to make a request to your API for every incoming request that Caddy receives (this would double the amount of request Caddy would make to your backends)?
There might be a way to do what you need without reaching out to your API, but it depends why you need to reach out to your API.
So we reach out to our API the first time, to make sure we can issue the SSL. API will give it the OK.
The second time, the API will return the URL we want to be masked.
Could this just be done in 1 request?
Okay, so youâre talking about On-Demand TLS I assume. Yes, thatâs fine.
Iâm not sure what you mean by âmaskedâ here. What does this mean? Caddy doesnât leak where it sends the request upstream (that would be silly).
No, those are separate pieces of the puzzle. The ask
endpoint is in a separate part of the system from reverse_proxy
.
The ask
endpoint is also only called when Caddy doesnât have a certificate and wants to try to have one issued. Once Caddy has a certificate, it doesnât call that endpoint again until the cert expires.
This topic was automatically closed after 60 days. New replies are no longer allowed.