title: Forwarding domains to docker containers
body: <p>I want to <strong>forward requests</strong>(via domain name) from <strong>public IP</strong> to <strong>docker containers</strong>.
  My network looks like this:
  <a href="https://i.stack.imgur.com/47vkH.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/47vkH.jpg" alt="Scheme of the network."></a></p>
  
  <p><strong>It should works like this:</strong><br>
  first.com &ensp; &ensp; &ensp;&ensp;-> &ensp; "first" container, &ensp;&ensp;&ensp;&ensp;&ensp; 172.17.0.2/16<br>
  mail.first.com &ensp;-> &ensp; "first-mail" container, &ensp;172.17.0.3/16<br>
  second.com &ensp;&ensp;-> &ensp; "second" container, &ensp;&ensp;172.17.0.4/16</p>
  
  <p>But I have an experience only to forwarding ports. I guess I need a conditional forwarding <strong>depended on an information of domain name</strong> from the internet request.
  Something like this for the router:</p>
  
  <pre><code>if(request.DomainName == "*.first.com" ||
     request.DomainName == "*.second.com"
  {
      forward(request, "10.0.0.10");
  }
  </code></pre>
  
  <p>And for the "Docker host" machine similarly.</p>
  
  <p>But I can't find any examples for this forwarding. Am I misunderstand how it should be?</p>