<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<META http-equiv=Content-Type content="text/html; charset=koi8-r">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
  margin: 5px 5px 5px 5px;
  background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal text */
{
 font-size: 9pt;
 font-family: 'Courier New';
 font-style: normal;
 font-weight: normal;
 color: #000000;
 text-decoration: none;
}
span.rvts1 /* Heading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #0000ff;
}
span.rvts2 /* Subheading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #000080;
}
span.rvts3 /* Keywords */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-style: italic;
 color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
span.rvts6
{
 font-size: 11pt;
 font-family: 'tahoma';
 font-weight: bold;
 color: #ffffff;
 background-color: #0000ff;
}
span.rvts7
{
 font-size: 11pt;
 font-family: 'tahoma';
}
a.rvts8, span.rvts8
{
 font-size: 11pt;
 font-family: 'tahoma';
 color: #0000ff;
 text-decoration: underline;
}
span.rvts9
{
 font-size: 8pt;
 font-family: 'arial';
 font-style: italic;
 color: #c0c0c0;
}
a.rvts10, span.rvts10
{
 font-size: 8pt;
 font-family: 'arial';
 color: #0000ff;
 text-decoration: underline;
}
a.rvts11, span.rvts11
{
 color: #0000ff;
 text-decoration: underline;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
 text-align: left;
 text-indent: 0px;
 padding: 0px 0px 0px 0px;
 margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
 text-align: center;
}
--></style>
</head>
<body>

<p>В примере только то что нужно Вам. Помимо этого есть еще несколько обязательных опций, но их опущу.</p>
<p>Для Apache:</p>
<p>NameVirtualHost 127.0.0.2:80</p>
<p><br></p>
<p>&lt;VirtualHost 127.0.0.2:80&gt;</p>
<p>ServerName www.domain.com</p>
<p>&lt;/VirtualHost&gt;</p>
<p><br></p>
<p>&lt;VirtualHost 127.0.0.2:80&gt;</p>
<p>ServerName www1.domain.com</p>
<p>&lt;/VirtualHost&gt;</p>
<p><br></p>
<p>&lt;VirtualHost 127.0.0.2:80&gt;</p>
<p>ServerName www2.domain.com</p>
<p>&lt;/VirtualHost&gt;</p>
<p><br></p>
<p>Для nginx:</p>
<p>server {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; listen 62.149.12.168:80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; server_name&nbsp;<a class=rvts11 href="www.domain.com">www.domain.com</a></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location / {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_pass &nbsp; http://127.0.0.2:80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_redirect &nbsp; &nbsp; &nbsp;off;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;Host &nbsp; &nbsp;$host;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;X-Real-IP &nbsp; &nbsp; &nbsp; &nbsp;$remote_addr;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;X-Forwarded-For &nbsp;$proxy_add_x_forwarded_for;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>}</p>
<p><br></p>
<p>server {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; listen 62.149.12.168:80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; server_name&nbsp;<a class=rvts11 href="www.domain.com">www1.domain.com</a></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location / {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_pass &nbsp; http://127.0.0.2:80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_redirect &nbsp; &nbsp; &nbsp;off;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;Host &nbsp; &nbsp;$host;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;X-Real-IP &nbsp; &nbsp; &nbsp; &nbsp;$remote_addr;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;X-Forwarded-For &nbsp;$proxy_add_x_forwarded_for;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>}</p>
<p><br></p>
<p>server {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; listen 62.149.12.168:80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; server_name&nbsp;<a class=rvts11 href="www.domain.com">www2.domain.com</a></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location / {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_pass &nbsp; http://127.0.0.2:80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_redirect &nbsp; &nbsp; &nbsp;off;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;Host &nbsp; &nbsp;$host;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;X-Real-IP &nbsp; &nbsp; &nbsp; &nbsp;$remote_addr;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_set_header &nbsp; &nbsp;X-Forwarded-For &nbsp;$proxy_add_x_forwarded_for;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>}</p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts9>--&nbsp;</span></p>
<p><span class=rvts9>С уважением,</span></p>
<p><span class=rvts9>&nbsp;Алексей Бобок &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><a class=rvts10 href="mailto:alexey.bobok@gmail.com">mailto:alexey.bobok@gmail.com</a></p>

</body></html>