Docker Community Forums

Share and learn in the Docker community.

Redirect all outgoing HTTP requests of one container to specified port of another container

(Pavel Sychev) #1

We have two containers - A and B.
A container makes http request to some http website. What I need is to redirect all these packets to specified port of container B.
I think, that some “voodoo” with iptables should work, but I’m not a specialist in this field. So, please, help me to solve this problem.

P.S. Term “http” in this question is just a placeholder - I’m interested in redirection of any tcp traffic, that is directed to specified port NNN.


(Dvohra) #2

Set port forwarding to the IP Address of the container.

(Pavel Sychev) #3

Can you please provide me with more detailed description of your proposed solution? For example, give some commands or a link to the docs page.