개발지식
nginx 업로드 파일 용량 초과 오류 HTTP 413 client intended to send too large body [해결]
dodo1054
2023. 7. 3. 11:55
반응형
client intended to send too large body: 706373782 bytes, client: cli, server: example.com, request: "POST /upload"
nginx 의 가상 호스트 최대 용량을 지정하는 키워드인
client_max_body_size 설정 사이즈 보다 큰 파일들이 업로드 되었을 때 발생
cd /etc/nginx/sites-available/
vi default
// default 파일
server {
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
//사이즈를 늘려주자
//없을 경우 client_max_body_size 추가
client_max_body_size 256M;
}
client_max_body_size http, server, location 구문에서 설정이 가능함
반응형