{"id":65,"date":"2018-04-24T05:42:37","date_gmt":"2018-04-24T05:42:37","guid":{"rendered":"http:\/\/td_uid_16_5adec3cd57ad4"},"modified":"2018-05-26T08:15:01","modified_gmt":"2018-05-26T08:15:01","slug":"how-to-fix-413-request-entity-too-large-error-on-nginx","status":"publish","type":"post","link":"https:\/\/forumweb.hosting\/blog\/how-to-fix-413-request-entity-too-large-error-on-nginx\/","title":{"rendered":"How to fix 413 request entity too large error on Nginx"},"content":{"rendered":"<p><a href=\"https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx.jpg\"><img loading=\"lazy\" class=\"wp-image-461 alignleft\" src=\"https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx.jpg\" alt=\"\" width=\"244\" height=\"181\" srcset=\"https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx.jpg 534w, https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx-300x222.jpg 300w, https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx-80x60.jpg 80w, https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx-265x198.jpg 265w, https:\/\/forumweb.hosting\/blog\/wp-content\/uploads\/2018\/04\/How-to-fix-413-request-entity-too-large-error-on-Nginx-485x360.jpg 485w\" sizes=\"(max-width: 244px) 100vw, 244px\" \/><\/a>In the process of installing a new webserver such as adding a plugin, theme or upload a large image file, you will often encounter 413 Request Entity Too Large error.<\/p>\n<p><strong>Reason<\/strong><br \/>\nBecause the Web Server Nginx and PHP limit the size of the file upload to the server. This error occurs even when you use phpmyadmin to restore the website.<\/p>\n<p>To handle this error you have to configure both on Nginx and PHP-FPM.<\/p>\n<p><strong>Edit configuration on Nginx<\/strong><br \/>\nSSH to the server find the nginx configuration file with \/etc\/nginx\/nginx.conf<\/p>\n<p>Then add the below directive to http block {&#8230;}, server {&#8230;}, or location {&#8230;}.<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>client_max_body_size client 15M;<\/p><\/blockquote>\n<p>Server that is configured vhost then you add to block server for easy management.<\/p>\n<p>The configuration on the file size up up to 15M max, usually theme or wordpress plugin is only about 10M or more than that a bit then.<\/p>\n<p><strong>Configure PHP-FPM\u00a0<\/strong><br \/>\nFor each operating system the path to the PHP configuration file is slightly different, you use the nano to open php.ini file.<\/p>\n<p>Path on Ubuntu<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>nano \/etc\/php\/7.0\/fpm\/php.ini<\/p><\/blockquote>\n<p>Path on CentOS<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>nano \/etc\/php.ini<\/p><\/blockquote>\n<p>You correct this value<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>upload_max_filesize = 15M<br \/>\npost_max_size = 15M<\/p><\/blockquote>\n<p>Take the change and restart nginx and php-fpm<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>#nginx<br \/>\nsystemctl restart nginx<\/p><\/blockquote>\n<blockquote class=\"td_quote_box td_box_left\"><p># php-fpm<br \/>\nsystemctl restart php7.0-fpm<\/p><\/blockquote>\n<p>There are some other basic errors that you should also pay attention when installing new VPS:<\/p>\n<p>Good luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the process of installing a new webserver such as adding a plugin, theme or upload a large image file, you will often encounter 413 Request Entity Too Large error. Reason Because the Web Server Nginx and PHP limit the size of the file upload to the server. This error occurs even when you use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":461,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[62,63],"_links":{"self":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts\/65"}],"collection":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":7,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":462,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions\/462"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/media\/461"}],"wp:attachment":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}