Have you tried simply proxying to the Squid server? Caddy will simply return whatever the Squid proxy returns, so a proxy chain should not pose any problems.
I do not want to configure Squid to make reverse proxy.
In this case to achieve reverse proxy chain, it is easier to run another Caddy server on different TCP port on Squid host…
Then Caddy must talk to Squid and Squid must talk to the APIs. Caddy talks HTTP, so it must use a HTTP proxy to talk to Squid.
I can help you with configuration but I don’t understand your requirements. If you don’t want to use a reverse proxy, how else do you envision this could be achieved?
each api have fqdn: api1.web.com api2.web.com dash.web.com yum.repo.web.com
etc…
I use HTTPS Squid forward proxy with method CONNECT for Python with os module to reach all backends API, yum to fetch system updates, or curl with shell https_proxy variable.
maybe it’s a stupid idea …but I thought it is possible to make reverse via forward…
OK, so I don’t believe Caddy can reverse proxy through a forward proxy. There’s no way to configure the proxy directive to CONNECT to a forward proxy before issuing its request upstream.
You COULD chain forward proxies - have Caddy act as a forward proxy and chain to Squid’s forward proxy - but then you’re left still with a forward proxy instead of regular HTTP access through Caddy. This might not be useful for you.
Based on that diagram, if all APIs are known, chained reverse proxies is the best way to go about achieving what you want.
I see. Could you see if there is a relevant issue related to forward-proxying and, after searching if you don’t find one that is the same as yours, could you open a new issue to request the feature? For version 2.
I dunno if this makes any difference, but in Caddy 2, you can reverse proxy to dynamic backends based on the request if necessary…