http://nginx.org/en/docs/http/load_balancing.html
https://www.lesstif.com/pages/viewpage.action?pageId=35357063
http {
upstream backend {
server my1.example.com;
server my2.example.com;
server my3.example.com;
}
server {
listen 80;
location / {
proxy_pass <http://backend>;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
max_failsfail_timeout
proxy_next_upstream: 특정 경우(연결에러 / 타임아웃 / 유효하지않은 헤더 / 응답코드 500, 502, 503, 403, 404, 429 등..)일 경우 다음 서버를 시도backup: primary 서버가 이용불가능 할때만 backup 서버로 시도down: 해당 서버를 실패로 표시keepalive