Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: помогите настроить nginx для 30 VurtulaHost находя щихся на 1 IP.
- To: xorme xorme1 <nginx-ru@xxxxxxxxx>
- Subject: Re: помогите настроить nginx для 30 VurtulaHost находя щихся на 1 IP.
- From: Alexey Bobok <alexey.bobok@xxxxxxxxx>
- Date: Sun, 9 Sep 2007 20:18:40 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:x-mailer:reply-to:x-priority:message-id:to:subject:in-reply-to:references:mime-version:content-type:content-transfer-encoding; bh=Zrg6FBA4iRDSqVg7SC6B9CPviXdy6nXzPk59R11KFdY=; b=JLctdFwTvQmNNV6c+vsxNhlm1TQq0B4OLBMrERzti3oMjdjPomkRpgziJWkH5r2s4XPA6KXBvtWvvfHS1EzRsRfe8WKIHDKh66b9II2aRwRgsxYlaG8NxC/TLiFKK5TR42/NwEZvAswqk6c2NJ0DRmV0KaqjLYWwVf82FYh6luk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:x-mailer:reply-to:x-priority:message-id:to:subject:in-reply-to:references:mime-version:content-type:content-transfer-encoding; b=Q4Hangl/gtvohEv3K+R/ISscUg4c+cPuxeEIyiJdErYezNZUseU32hepZAxRIRGecsjdkuh31u7xGcUf9+2L/sXljFtHui8MQ1K2otCFfBp5IshRyoHL0vQjHICt7oizQ8nN0uE3wAiAGRvJWh6H9vAg7L7RG2w+mZbcQj/9lOQ=
- In-reply-to: <c27bf0460709090949p72ac66b6r8ca3ef1c3eaf6df4@xxxxxxxxxxxxxx>
- References: <c27bf0460709090949p72ac66b6r8ca3ef1c3eaf6df4@xxxxxxxxxxxxxx>
В примере только то что нужно Вам. Помимо этого есть еще несколько обязательных опций, но их опущу.
Для Apache:
NameVirtualHost 127.0.0.2:80
<VirtualHost 127.0.0.2:80>
ServerName www.domain.com
</VirtualHost>
<VirtualHost 127.0.0.2:80>
ServerName www1.domain.com
</VirtualHost>
<VirtualHost 127.0.0.2:80>
ServerName www2.domain.com
</VirtualHost>
Для nginx:
server {
listen 62.149.12.168:80;
server_name www.domain.com
location / {
proxy_pass http://127.0.0.2:80;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 62.149.12.168:80;
server_name www1.domain.com
location / {
proxy_pass http://127.0.0.2:80;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 62.149.12.168:80;
server_name www2.domain.com
location / {
proxy_pass http://127.0.0.2:80;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
--
С уважением,
Алексей Бобок mailto:alexey.bobok@xxxxxxxxx
|