mash-up-kr / ACM-Backend

11기 앺최몇 프로젝트 서버
25 stars 1 forks source link

배포중이면 502 응답하기 #150

Closed junhaesung closed 2 years ago

junhaesung commented 2 years ago

nginx 설정 추가 배포중일 때 502 BAD GATEWAY 발생함 에러페이지 내용 수정은 했는데, content-type: text/htmlcontent-type: application/json 으로 바꾸어야함

아래처럼 경로 이름을 json 으로 쓰면 content-type: application/json 으로 설정됨

server {
    ...
    error_page 502 /502.json;
    location /502.json {
        return 502 '{"data": null, "code": "BAD_GATEWAY", "message": "received an invalid response from the upstream server"}';
    }
}