How to fix ‘failed (22: Invalid argument) while sending response to client’ – nginx

Nginx Error Logs

:::::: failed (22: Invalid argument) while sending mp4 to client, :::::::

Hard drive information

Hard drives with 512 
Units = sectors of 1 * 512 = 512 bytes 
Sector size (logical/physical): 512 bytes / 4096 bytes 
I/O size (minimum/optimal): 4096 bytes / 4096 bytes 

New hard drive with 4096 
Units = sectors of 1 * 4096 = 4096 bytes 
Sector size (logical/physical): 4096 bytes / 4096 bytes 
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Add nginx.conf

aio threads;
aio_write on;
directio 8M;
directio_alignment 4k;

$ sudo systemctl reload nginx