Nginx 부하 균형 과 역방향 대리 실현

797 단어 웹 개발
사이트 의 안정 을 유지 하기 위해 서 는 부하 균형 을 설정 해 야 하기 때문에 사이트 의 안정성 을 향상 시 키 고 다운 사이트 한 대가 로그 인 할 수 없 는 현상 을 피 할 수 있 습 니 다. 현재 유행 하 는 Nginx 로 부하 균형 설정 을 하 는 것 은 매우 간단 합 니 다. nginx - 1.4.7 \ conf 아래 의 nginx. conf 파일 만 수정 하면 됩 니 다.
//      
 	upstream solr_group {
 ip_hash;
//       ip hash    ,                 ,     session   。
				server 172.16.8.69:8080 max_fails=3 fail_timeout=20s;
				server 172.16.8.69:8881 max_fails=3 fail_timeout=20s;
				server 127.0.0.1:8080  max_fails=3 fail_timeout=20s;
   	 }

    server {
        listen       80;
        server_name  127.0.0.1;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
			proxy_pass http://solr_group;
        }

좋은 웹페이지 즐겨찾기