HTTP rewriter for docker

I want to run a docker container, and somehow intercept/modify HTTP responses in the host. That means, basically take every HTTP response coming out of the container, and modify it before sending it back to the user. Is there a standard way to do this in docker?

  • Need to take image of docker image or container from application installed machine in AWS
  • Database created in Dockerfile does not appear in running container
  • Builder Docker image resulting in running container
  • Dockerode : run omxplayer command
  • npm ERR! Failed when make ionic serve command (ask for checking version of node.js and npm installed)
  • How to find dependencies before installing a PHP extension with Docker
  • How can I access my docker maria db?
  • Updating PATH environment variable permanently in Docker container
  • Gradle not able to download andriod packages
  • App in Docker does not update
  • Running SpringBootApplication PostConstruct and PreDestroy
  • Docker networking on single host with compose
  • 2 Solutions collect form web for “HTTP rewriter for docker”

    What you could do is create a reverse proxy.

    All communication in and out of the docker container is done indirectly, trough the proxy. So clients connect to the reverse proxy, the proxy requests the information from the process inside the container. The proxy will also handle the response to the client.

    If you simply want to change some headers, a default setup of an apache reverse proxy might be enough.
    See this link on how to set up a reverse proxy using apache:

    Other proxy technologies you might consider:
    – Nginx
    – HAProxy

    If you want to do more than just changing headers (please fill me in!) than you might have to write some code to handle that for you.

    Good luck! And let me know if you need more help!

    Something like mitmproxy. Docker does not change the approach.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.