Fix client intended to send too large body: xyz bytes in Nginx

Originally published at: https://www.cyberciti.biz/faq/fix-client-intended-to-send-too-large-body-xyz-bytes-in-nginx/

I am getting the following error when trying to upload file using Nginx web server:
    2018/01/21 12:19:23 [error] 375#375: *25019 client intended to send too large body: 3881539 bytes, client: 102.21.181.13, server: www.cyberciti.biz, request: “POST /cms/wp-admin/async-upload.php HTTP/2.0”, host: “www.cyberciti.biz”, referrer: “https://www.cyberciti.biz/cms/wp-admin/post.php?post=&action=edit
How do I fix this problem and allow file uploads upto 10MB?