엔진엑스 파일 전송 용량 늘리기

빔밀·2023년 4월 6일

프런트에서 서버에 파일을 보낼 때 엔진엑스에서 용량을 제한 하는가 보다.
express: 413 payload too large

api 호출을 할때 서버 로그에서는 요청이 확인이 안됬는데 프런트 쪽에서는 오류가 떠서 찾아보니까 엔진엑스에서 문제가 생긴 듯 했다.

설정을 변경 하기 전에 엔진엑스를 끄고

sudo systemctl stop nginx
sudo vim /etc/nginx/nginx.conf

여기서 용량 설정을 다시 해준다.

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##
        client_max_body_size 10M;#이부분을 추가해준다.
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

다시 실행하면 된다.

sudo nginx -t
sudo systemctl restart nginx
profile
의미있는 한줄

0개의 댓글