문제 내용

https://talk-dev.thecloudgate.io/message/send_message

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/aece943d-e83e-4041-9dfe-e7658ef9bff3/_2020-10-20__11.40.32.png

대량 메세지 전송을 위해 약 12만건의 엑셀 데이터를 업로드(1.5M) 하여 전송하려하니 위와 같은 에러 뜸.

원인

클라이언트의 브라우저에서 파일 전송시 파일의 크기가 허용 용량을 초과하여 발생.

nginx에서 따로 설정을 해주지 않는다면 1M가 기본 옵션.

해결

nginx 업로드 사이즈를 설정한다.

  1. cd /etc/ngixn/ngixn.conf

  2. client_max_body_size 옵션 추가 또는 사이즈 변경

    client_max_body_size 100M;
    
  3. nginx 재설정 또는 재시작

    nginx -s reload
    service nginx restart
    

참고

nginx 413 Request Entity Too Large 에러 해결하기, 파일 업로드 사이즈