1MB보다 큰 파일 업로드 = 연결 재설정 = /var/www/site1/php_error.log error_reporting = 22527 file_uploads

프론트 엔드에서 nginx를 “프록시 캐시”로 사용하고 백엔드에서 아파치를 사용하고 있습니다. PHP 설정을 다음과 같이 설정했습니다.

error_log = /var/www/site1/php_error.log
error_reporting = 22527
file_uploads = On
log_errors = On
max_execution_time = 0
max_file_uploads = 20
max_input_time = -1
memory_limit = 512M
post_max_size = 0
upload_max_filesize = 1000M

뭐가 문제 야? 1MB 미만의 파일을 업로드하면 성공하지만 그보다 큰 것은 Chrome에서 출력합니다.

Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.

이미 오류 로그 파일을 확인했지만 디렉토리에 존재하지 않습니다. 또한 확인 /var/log/httpd/error_log했지만 업로드 관련 문제가 없습니다. 문제를 일으킨 다른 내용을 모르므로 도움을 청했습니다. 감사!



답변

나는 문제를 발견했다.

nginx.conf에서 :

http {
    client_max_body_size 0;
}

로 설정 client_max_body_size했습니다 0. 기본값은 1M입니다.


답변

왜 그렇 post_max_size = 0습니까?

1000M대부분의 업로드는 POST 요청이므로 적어도 귀하의 경우에 있어야 합니다.