I have nginx version: 1.12.0 and the following configuration:
http {
server {
listen 443;
server_name SERVER_NAME_OR_IP;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log debug;
ssl on;
ssl_certificate /path/to/cert.crt;
ssl_certificate_key /path/to/cert.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location ~* /test/abcd/ {
proxy_pass http://127.0.0.1:7000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_address;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 127.0.0.1:7000;
server_name SERVER_NAME_OR_IP;
location / {
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_VALUE "upload_max_filesize = 3072M
post_max_size=3072M";
include /etc/nginx/fastcgi_params;
}
}
}
If the client closes connection during uploading a file, I see in /var/log/error.log : "epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream" and "client prematurely closed connection" . My problem is that php-fpm doesn't receive that error when client closes connection, so I can't catch this error in my code. Do you know what might be the problem?
Thank You!