Activities

August 2015
M T W T F S S
« Jul   Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Nginx Error : 413 Request Entity Too Large

The Web server (running the Web site) thinks that the HTTP data stream sent by the client (e.g. your Web browser or something you feed in application) was simply too large i.e. too many bytes than normal. What constitutes ‘too many bytes‘ depends partly upon the operation being attempted. For example a request to upload a very large file (via the HTTP PUT method) may encounter a ceiling on upload file size set by the Web server.

In My senario I’m using the combination of Nginx and php-fpm communication. Initially I’d increased the value of “upload_size, post_max_size” in php settings and restarted the php-fpm socket server. But still I’m receiving the same error.

[root@QA01 ~]# cat  /etc/php.ini | grep -E "post_max_size|upload_max_filesize"
post_max_size = 12M
upload_max_filesize = 10M
[root@QA01 ~]#/etc/init.d/php-fpm restart
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]

Now I turned to Web server end to check further and identify that we need to modify the accept header size to make it completed. So edit Nginx configuration file for that virtual host and added “client_max_body_size 10M;” line in between the lines. Then reload the Ngnix server

[root@QA01 ~]# /etc/init.d/nginxd reload
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful
$”Reloading nginx: ”                                       [  OK  ]
[root@QA01 ~]#

Problem solved !!

Moral of the story : When you have an issue, first you need to know the reason which cause to happen and find the option which will not happen it back.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>