I have a very specific testing situation where I want to use a forward proxy like so:
Client -> Forward Proxy 1 -> Forward Proxy 2 (WireMock) | -> Internet
Forward Proxy 1 would be responsible for forwarding requests for a whitelist of (destination) hosts to Forward Proxy 2 (WireMock), which may send back a mock response or may proxy further to the client's intended destination host. All other (non-whitelisted) requests should be proxied directly to the client's intended destination host by Forward Proxy 1.
The solution must support HTTPS requests. For the WireMock path, WireMock is acting as a MITM and generating self-signed SSL responses sometimes (which the clients are set up to trust, but I don't know if this is relevant for Forward Proxy 1). This solution needs to be available as a docker image, should be as lightweight as possible, and does not need to be particularly performant.
I've tried figuring out how to configure nginx, Squid, HAProxy like this, but no luck so far. Any pointers on how to attack this?