본문 바로가기

Ops/AWS

AWS ELB - health check (nginx 설정)

반응형

AWS ELB - health check (nginx 설정)

 

 

 

 

LB 설정 (상태체크 URL)

/elb-status

 

nginx 설정

server {
        location /elb-status {
                access_log off;
                return 200 'A-OK!';
                add_header Content-Type text/plain;
        }
}

 

nginx 설정 (전체 예시)

server {
    listen       80;
    server_name  example.com;

    access_log off;
    error_log /home/search/log/nginx.error.log;

    server_tokens off;
    root   /home/chandler/html;

    error_page  403 /403.html;
    location = /403.html {
      root   /etc/nginx/html;
    }

    error_page  400 404 /404.html;
    location = /404.html {
      root   /etc/nginx/html;
    }

    error_page  500 501 502 503 504  /500.html;
    location = /500.html {
      root   /etc/nginx/html;
    }

    location / {
      index.html
    }
    
    location /elb-status {
        return 200 'A-OK!';
        add_header Content-Type text/plain;
    }
}

 

 

 


by mkdir-chandler


 

 

 

 

 

728x90
반응형