nginx 도 메 인 이름 전송 부하 균형 역방향 에이전트

4021 단어
          ,  IP   ,      ,      IP         ,
     www.abc.com      ,   www.bbc.com    192.168.0.35     ,
   192.168.0.35   nginx php  。
#vi /usr/local/nginx/conf/nginx.conf
#       
 upstream www    # www    ,         
{
server xxx.xxx.xxx.xxx:80 max_fails=3 fail_timeout=30s; # IP, 80 , 。
}
upstream bbs
{
server xxx.xxx.xxx.xxx:8080 max_fails=3 fail_timeout=30s;
}

server {
listen 80;
server_name www.abc.com;
location / {
index index.html index.php index.jsp index.htm;
proxy_pass http://www;# , httpURL
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;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
#proxy_buffers 32 4K;
}


}
server {
listen 80;
server_name bbs.abc.com ;
location / {
index index.html index.php index.jsp index.htm;
proxy_pass http://bbs;
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;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
#proxy_buffers 32 4K;
}
}


```````````````````````````````````````````````````````````````````````````````
                     ,      ,nginx             ,                。

 
 
  upstream bbs
{
server xxx.xxx.xxx.xxx:8080 max_fails=3 fail_timeout=30s;
 server 192.168.0.23:80 max_fails=3 fail_timeout=30s;
}

    nginx    ,      。
#/usr/local/nginx/sbin/nginx -t
#service nginx restart.
         ,          ,               。
           ,     ,           。

좋은 웹페이지 즐겨찾기