I have an application that is running in Docker configured with an NGINX reverse proxy. The application is a binary, I don't have source code and there's no way to modify the header of an HTTP request from the app itself. My goal is to append a header field before the request is dispatched out of the host machine:
/// @dev some http proxy or similar
listener(PORT, function(request) {
// 1) modifies header
request.setHeader('FOO', 'bar')
// 2) passes through to original or intended destination
request.continue()
})
The key is to modify the request's header within the host machine where the Docker app is running.
I looked at MITM proxies and to reroute the Docker outbound traffic with iptables or socat.
Is there anything you would suggest for this operation?