기본 콘텐츠로 건너뛰기

Kubernetes Ingress 사용시 Upstream 에러 ( An invalid response was received from the upstream server )

 

버전 정보

K8S Version : 1.28

Ingress : Kong


Kong Log

upstream sent too big header while reading response header from upstream, client


문제 정의

Upstream 시 header size 가 작아서 에러가 나는 현상


해결 방안

/usr/local/kong/nginx-kong.conf 파일에 buffer size 를 늘려줌으로 해결

방안1 : /usr/local/kong/nginx-kong.conf 을 mount 하여 진행

nginx-kong.conf 을 만들어 진행

------------------------------------------------
...
fastcgi_buffers 4 32k;
fastcgi_buffer_size 28k;
fastcgi_busy_buffers_size 32k;
...
server {
...
proxy_buffer_size 28k; proxy_buffers 4 32k; proxy_busy_buffers_size 32k;
}
...
-----------------------------------------------

방안2 : Deployment 에 spec.env 값을 주어 진행

  • - name: KONG_NGINX_PROXY_PROXY_BUFFER_SIZE
    value: "28k"
    - name: KONG_NGINX_PROXY_PROXY_BUSY_BUFFERS_SIZE
    value: "32k"
    - name: KONG_NGINX_PROXY_PROXY_BUFFERS
    value: "4 32k"
    - name: KONG_NGINX_HTTP_CLIENT_HEADER_BUFFER_SIZE
    value: "28k"
    - name: KONG_NGINX_HTTP_FASTCGI_BUFFER_SIZE
    value: "32k"
    - name: KONG_NGINX_HTTP_FASTCGI_BUSY_BUFFERS_SIZE
    value: "32k"
    - name: KONG_NGINX_HTTP_FASTCGI_BUFFERS
    value: "4 32k"


참조

https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size
https://dev.jaedong.kim/nginx-upstream-sent-too-big-header-while-reading-response-header-from-upstream-error/
https://doogle.link/nginx-proxy-502-bad-gateway-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0%ED%95%98%EA%B8%B0-bad-upstream-sent-too-big-header-while-reading-response-header-from-upstream/

댓글

이 블로그의 인기 게시물

블록체인 거래소 모니터링시스템 구축이야기(2/?) - 서버 아키텍처

  코인 거래소 모니터링시스템 구축이야기(2/?) 코인 거래소 모니터링 시스템 구축 (가칭 : 김프멈춰) 서버 구성 사용자가 확인할 서비스 페이지, 데이터 저장소에 대한 서버는 NAS 서버로 운영 일일 Data 크롤링 서버는 Cloud 서버 이용하여 운영 - 서비스페이지 및 데이터 저장소 (Nas 서버) : Docker container ubuntu 20.04 - 일일 크롤링 서버 (Cloud at Cost Cloud 서버) : CentOS 7 서버 아키텍처 서버 아키텍처 레퍼런스 빗썸 : https://apidocs.bithumb.com/ 업비트 : https://docs.upbit.com/ 홍콩 Bitfinex : https://docs.bitfinex.com/docs 몽고 DB 설치 : https://coterie.tistory.com/20 1. 개요 :  https://limdh3325.blogspot.com/2021/04/1.html 2. 서버 아키텍처 :  https://limdh3325.blogspot.com/2021/04/2.html 3. MongoDB 설치 :  https://limdh3325.blogspot.com/2021/04/3.html 4. 데이터 모델링 :  https://limdh3325.blogspot.com/2021/05/4.html 5. MongoDB 저장 :  https://limdh3325.blogspot.com/2021/06/5.html