ðòïåëôù 


  áòèé÷ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  óôáôøé 


  ðåòóïîáìøîïå 


  ðòïçòáííù 



ðéûéôå
ðéóøíá












     áòèé÷ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to configure multiple virtual server on nginx?


  • To: nginx-ru@xxxxxxxxx
  • Subject: how to configure multiple virtual server on nginx?
  • From: "debugger87" <nginx-forum@xxxxxxxx>
  • Date: Tue, 26 Jul 2011 22:30:49 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=ipoFzTVUF18XWXk4EGmQrWSeXGHB/cbY5Tblt7uD7EM=; b=raf3Xq9zwi54OfSD/j+d7DmSY8a0O1ZFb56H80SBBrM1AElmEE/IilbJXAQ2RktzdZcLAWvly1p4e+FzQz96Yhw93RXA0DTvNe/PwoPaA2nWWZ1+Y3325mzF8GRHOzsp;

Hi,all
Pardon please,I'm not an russian native speaker.So,I write my mail post
in english.
I have 4 IP address on my ubuntu server computer.For the convenience to
ditinguish them ,I name them as IP-1,IP-2,IP-3 and IP-4.
Now,I configure 3 virtual servers on nginx.The key content of
configuration is following.

#upstream
upstream my_upstream{
server IP-3:8080;
server IP-4:8080;
}

#the first server
server {
listen IP-1:80;
location / {
index index.php;
root /usr/share/nginx/www;
}
location ~.*\.(php|php5)$ {
root /usr/share/nginx/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}

#the second server
server {
listen IP-2:80;
location / {
index index.php;
root /usr/share/nginx/www;
}
location ~.*\.(php|php5)$ {
root /usr/share/nginx/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}

#the third server
server {
listen IP-3:80;
location / {
proxy_pass http://my_upstream;
}
location ~.*\.(php|php5)$ {
root /usr/share/nginx/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
########################################################

In my opinion,those 3 virtual servers can wholely work right.But I met a
very surprising problem:the 1st and 2nd server can work
right,nevertheless?the third virtual server can not access.I look over
nginx.conf,and never find out any configuration mistake.Then,I change
the 3rd server's LISTEN IP address IP-3 to IP-2,and change the 2nd
server's LISTEN IP address IP-2 to IP-3.Oh my god,the 2nd server can not
access,but the 3rd can.I just exchange their LISTEN IP address.If you
have understood my problem description,would you please give me some
good suggestion?
Thanks!

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,212970,212970#msg-212970

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.