502vs504 - horoyoii/simple-load-balancer GitHub Wiki
502 Bad Gateway
1. ๋ฐ์ ์กฐ๊ฑด
- upstream ์๋ฒ๊ฐ ๋ชจ๋ down ๋์ด์์ ๋ - connection refused
2020/06/15 15:21:32 [error] 19845#19845: *15 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: naver.com, request: "GET /ping HTTP/1.1", upstream: "http://127.0.0.1:8001/ping", host: "127.0.0.1:8081"
504 Gateway Time-out
- ์๋ต์ด ์ ํ์๊ฐ ๋ด๋ก ์ค์ง ์์ ๋ - Connection time out
server {
location / {
proxy_read_timeout 5s; // proxy_read_timeout ์ด 5์ด์ด๋ฉด, ์๋ต์ด 5์ด ๋ด๋ก ์์ฌ ๋ 504 ์๋ฌ
proxy_connect_timeout 1s;
proxy_pass http://wascluster;
}
// + /var/log/nginx/error.log
2020/06/15 15:19:43 [error] 19845#19845: *13 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: naver.com, request: "GET /ping HTTP/1.1", upstream: "http://127.0.0.1:8001/ping", host: "127.0.0.1:8081"