Nginx: 413 - Request Entity Too Large Error and Solution

Originally published at: https://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

I'm running nginx as a frond end to php based Apache+mod_fastcgi server. My app lets user upload images upto 2MB in size. When users trying to upload 1.5MB+ size image file using nginx reverse proxy, they are getting the following error on screen:

Nginx 413 Request Entity Too Large

How do I fix this problem and allow image upload upto 2MB in size using nginx web-server working in reverse proxy or stand-alone mode on Unix like operating systems?