I got the upload working with above changes. But when I made the changes I started getting 404 response in file upload which lead me to do further debugging and figured out its a permission issue by checking nginx error.log
Solution:
Check the current user and group ownership on /var/lib/nginx.
$ ls -ld /var/lib/nginx
drwx------. 3 nginx nginx 17 Oct 5 19:31 /var/lib/nginx
This tells that a possibly non-existent user and group named nginx owns this folder. This is preventing file uploading.
In my case, the username mentioned in "/etc/nginx/nginx.conf" was
user vagrant;
Change the folder ownership to the user defined in nginx.conf in this case vagrant.
$ sudo chown -Rf vagrant:vagrant /var/lib/nginx
Verify that it actually changed.
$ ls -ld /var/lib/nginx
drwx------. 3 vagrant vagrant 17 Oct 5 19:31 /var/lib/nginx
Reload nginx and php-fpm for safer sade.
$ sudo service nginx reload
$ sudo service php-fpm reload
The permission denied error should now go away. Check the error.log (based on nginx.conf error_log location).
$ sudo nano /path/to/nginx/error.log