{"id":256,"date":"2018-02-08T03:05:42","date_gmt":"2018-02-07T18:05:42","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=256"},"modified":"2018-02-08T03:05:42","modified_gmt":"2018-02-07T18:05:42","slug":"%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%81%af%ef%bc%93%e3%83%b5%e6%89%80%ef%bc%81-413-request-entity-too-large%e3%81%8c%e8%a1%a8%e7%a4%ba%e3%81%95%e3%82%8c%e3%81%9f%e6%99%82%e3%81%ae%e5%af%be%e5%87%a6","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=256","title":{"rendered":"\u30c1\u30a7\u30c3\u30af\u306f\uff13\u30f5\u6240\uff01 413 Request Entity Too Large\u304c\u8868\u793a\u3055\u308c\u305f\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"<p>\u6700\u8fd1\u306e\u6d41\u308c\u3067PHP\uff08Laravel\uff09\u3092\u52d5\u304b\u3059\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306fapache\u3067\u306f\u306a\u304f<strong>nginx<\/strong>\uff08\u203b\u3048\u3093\u3058\u3093\u3048\u3063\u304f\u3059\u3002\u30ed\u30b7\u30a2\u88fd\uff09\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u7406\u7531\u3068\u3057\u3066\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u65e9\u3044\u304b\u3089\uff01<\/strong><\/p>\n<p>\u3053\u308c\u306b\u3064\u304d\u307e\u3059\u3002\u904e\u53bb\u306b\u8aad\u3093\u3060\u8a18\u4e8b\u3067\u306f\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304capache\u306b\u6bd4\u3079\u3066\u683c\u6bb5\u306b\u5c11\u306a\u304b\u3063\u305f\u3093\u3067\u3059\u3002\u3082\u3061\u308d\u3093\u3001\u307e\u3060\u307e\u3060\u30b7\u30a7\u30a2\u3067\u3044\u3046\u3068apache\u306b\u306f\u52dd\u3066\u3066\u306a\u3044\u3067\u3059\u3051\u3069\u3001IE\u304cchrome\u306b\u4fb5\u98df\u3055\u308c\u305f\u3088\u3046\u306b\u3001\u3053\u308c\u304b\u3089\u5f90\u3005\u306b\u4eba\u6c17\u304c\u5897\u3048\u3066\u3044\u304f\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u8003\u3048\u3066\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u305d\u306e\u4eba\u6c17\u304b\u3089\u304b\u3001Laravel\u306e<a href=\"https:\/\/laravel.com\/docs\/5.5\/installation#pretty-urls\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u8aac\u660e<\/a>\u306b\u306fnginx\u306e\u8a2d\u5b9a\u65b9\u6cd5\u3082\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u65e9\u3044\u304b\u3089\uff01\uff08\uff12\u56de\u3081\u30fb\u6570\u5206\u3076\u308a\uff09<\/strong><\/p>\n<p>\u5b9f\u969b\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306bnginx\u3092\u3054\u5e0c\u671b\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u69d8\u3082\u5897\u3048\u3066\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u305d\u3057\u3066\u672c\u984c<\/h2>\n<p>\u3067\u3001\u672c\u984c\u306a\u3093\u3067\u3059\u304c\u3053\u306enginx\u3092\u4f7f\u3063\u3066\u3044\u308b\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3067\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">413 Request Entity Too Large<\/strong><\/p>\n<p>\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092Ajax\u3092\u4f7f\u3063\u3066\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u3057\u3066\u305f\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u5185\u5bb9\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">nginx\u300c\u3044\u3084\u3044\u3084\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u5bb9\u91cf\u30c7\u30ab\u3059\u304e\u306a\u3093\u3067\u3059\u3051\u3069\u30fc\uff01\uff08\u6c57\uff09\u300d<\/strong><\/p>\n<p>\u3063\u3066\u6012\u3063\u3066\u308b\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306enginx\u8a2d\u5b9a\u3060\u3068\u3001\u6700\u5927\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u304c1MB\u306b\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3001\u3053\u308c\u3092\u5909\u66f4\u3057\u306a\u304f\u3061\u3083\u3044\u3051\u306a\u3044\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4ed6\u306e\u30d6\u30ed\u30b0\u3067\u306f\u3042\u307e\u308a\u8a00\u53ca\u3055\u308c\u3066\u306a\u3044\u3067\u3059\u3051\u3069\u3001\u5408\u308f\u305b\u3066PHP\u5074\u3067\u3082\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306e\u6700\u5927\u5bb9\u91cf\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3063\u3061\u3082\u8a2d\u5b9a\u3057\u3066\u304a\u304b\u306a\u304f\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u3084\u308b\u3079\u304d\u3053\u3068\u306f\u30ba\u30d0\u30ea\uff01\u4ee5\u4e0b\u306e\uff13\u3064<\/p>\n<ul>\n<li><strong>nginx\u30fb\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/strong>\u306e<strong>client_max_body_size<\/strong>\uff08\u3082\u3057\u3042\u308b\u306a\u3089\u5909\u66f4\u3001\u306a\u3051\u308c\u3070\u8ffd\u52a0\uff09<\/li>\n<li><strong>php.ini<\/strong>\u306e<strong>post_max_size<\/strong><\/li>\n<li><strong>php.ini<\/strong>\u306e<strong>upload_max_filesize<\/strong><\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u3072\u3068\u3064\u305a\u3064\u8a2d\u5b9a\u65b9\u6cd5\u3092\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff08\u3053\u3053\u304b\u3089\u306f\u3001ssh\u306a\u3069\u3067\u30b5\u30fc\u30d0\u30fc\u5185\u90e8\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304b\u3089\u306e\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u3002\uff09<\/p>\n<h2><strong>client_max_body_size\u3092\u8a2d\u5b9a\u3059\u308b<\/strong><\/h2>\n<p>\u74b0\u5883\u306b\u3088\u3063\u3066nginx\u304c\u3069\u3053\u306b\u3042\u308b\u304b\u306f\u9055\u3044\u307e\u3059\u3051\u3069\u3001\u304a\u304a\u3080\u306d\u3001<\/p>\n<pre><strong>\/etc\/nginx\/<\/strong><\/pre>\n<p>\u306b\u3042\u308b\u3068\u601d\u3046\u3093\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d4\u30e7\u30fc\u30f3\uff01\u3068\u79fb\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>cd\u00a0\/etc\/nginx\/conf.d<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001*****.conf \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u304b\u3068\u601d\u3046\u3093\u3067\u3001\uff08\u79c1\u306e\u5834\u5408\u306f\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u5316\u3057\u3066\u308b\u3093\u3067\u5c02\u7528\u306econf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u307e\u3059\uff09\u3053\u308c\u3092vi\u306a\u3069\u3067\u958b\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><span style=\"text-decoration: underline;\">\u203b\u5168\u30b5\u30a4\u30c8\u306b\u9069\u7528\u3059\u308b\u5834\u5408\u306f \/etc\/nginx\/nginx.conf\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3044\u3044\u3088\u3046\u3067\u3059\u3002<\/span><\/p>\n<pre><strong>sudo vi *****.conf<\/strong><\/pre>\n<p>\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<strong>client_max_body_size<\/strong>\u3092\u5404\u30b5\u30fc\u30d0\u30fc\u8a2d\u5b9a\u306e\u4e2d\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n10m\u3068\u3044\u3046\u306e\u306f10\u30e1\u30ac\u30d0\u30a4\u30c8\u3001\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002\u3082\u3063\u3068\u5bb9\u91cf\u3092\u5927\u304d\u304f\u3057\u305f\u3044\u5834\u5408\u306f\u5404\u81ea\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<pre>server {\r\n  listen 80;\r\n  server_name example.com;\r\n  root \/var\/www\/html\/example;\r\n  index index.php index.html;\r\n  <strong>client_max_body_size 10m;<\/strong>\r\n  #\uff08....\u305d\u306e\u4ed6\u306e\u8a2d\u5b9a\u306f\u7701\u7565\u3057\u3066\u307e\u3059\uff09\r\n}\r\n<\/pre>\n<p>\u3061\u306a\u307f\u306b\u6c17\u3092\u3064\u3051\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u304c\u3001<span style=\"text-decoration: underline;\">https\u306b\u3082\u5bfe\u5fdc\u3055\u305b\u3066\u308b\u5834\u5408\u3067\u3059\u3002<\/span><br \/>\n\u305d\u306e\u5834\u5408\u3001443\u756a\u30dd\u30fc\u30c8\u90e8\u5206\u306b\u3082<strong>client_max_body_size<\/strong>\u3092\u8a2d\u5b9a\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u6ce8\u610f\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>\uff08\u3053\u306e\u9593\u3001\u3064\u3044\u306bchrome\u304chttp\u901a\u4fe1\u3060\u3068\u8b66\u544a\u3092\u51fa\u3059\u3088\u3046\u306b\u306a\u3063\u305f\u3093\u3067\u3001\u3053\u308c\u304b\u3089\u306fhttps\u4e00\u629e\u306a\u3093\u3067\u3057\u3087\u3046\u3051\u3069\u306d\uff09<\/p>\n<pre>server {\r\n  listen 443 ssl;\r\n  ssl_certificate \/etc\/letsencrypt\/live\/example.com\/fullchain.pem;\r\n  ssl_certificate_key \/etc\/letsencrypt\/example.com\/privkey.pem;\r\n  server_name example.com;\r\n  root \/var\/www\/html\/example;\r\n  index index.php index.html;\r\n  <strong>client_max_body_size 10m;<\/strong>\r\n  #\uff08....\u305d\u306e\u4ed6\u306e\u8a2d\u5b9a\u306f\u7701\u7565\u3057\u3066\u307e\u3059\uff09\r\n}\r\n\r\n<\/pre>\n<p>\u306f\u3044\uff01\u3053\u308c\u3067nginx\u5074\u306e\u8a2d\u5b9a\u306f\u7d42\u4e86\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067nginx\u3092\u518d\u8d77\u52d5\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\uff08\u518d\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u306fCentOS7\u7528\u3067\u3059\uff09<\/p>\n<pre><strong>sudo systemctl restart nginx\r\n<\/strong><\/pre>\n<h2>post_max_size\u3001upload_max_filesize\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p>\u3055\u3041\u3001\u6b21\u306fPHP\u5074\u306e\u8a2d\u5b9a\u3067\u3059\u3002<br \/>\n\u5909\u66f4\u3059\u308b\u306e\u306f<strong>php.ini<\/strong>\u306a\u306e\u3067\u3001\u3053\u306e\u8fba\u306f\u8a73\u3057\u3044\u4eba\u3082\u591a\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3067\u306f\u3001php.ini\u304c\u3069\u3053\u306b\u3042\u308b\u304b\u3092\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u691c\u7d22\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php -i | grep \"php.ini\"<\/strong><\/pre>\n<p>\u3053\u308c\u306f<\/p>\n<p>\u300cphp\u306e<strong>phpinfo()<\/strong>\u3067\u8868\u793a\u3067\u304d\u308b\u5185\u5bb9\u306e<strong>php.ini<\/strong>\u3068\u66f8\u304b\u308c\u3066\u308b\u5834\u6240\u3060\u3051\u8868\u793a\u3057\u3066\u306d\uff01\u300d<\/p>\n<p>\u3063\u3066\u3044\u3046\u547d\u4ee4\u6587\u3067\u3059\u3002<\/p>\n<p>\uff08\u305f\u3060\u3057\u3001\u3053\u308c\u3082\u74b0\u5883\u306b\u3088\u3063\u3066\u306f\u9055\u3046\u5834\u6240\u306ephp.ini\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u3082\u3042\u308b\u3068\u601d\u3046\u3093\u3067\u3001\u305d\u306e\u6642\u306f\u3042\u304d\u3089\u3081\u3066\u3001phpinfo()\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3067\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>Loaded Configuration File =&gt; \/etc\/php.ini<\/strong><\/pre>\n<p>\u3055\u3063\u305d\u304f\u3001\u3055\u3063\u304d\u307f\u305f\u3044\u306bvi\u3067\u958b\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>sudo vi \/etc\/php.ini<\/strong><\/pre>\n<p>\u3055\u3041\u3001<strong>post_max_size<\/strong>\u3068<strong>upload_max_filesize<\/strong>\u306e\u8a2d\u5b9a\u3067\u3059\u3002<br \/>\n\u6570\u5b57\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u3042\u3052\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>post_max_size = 10M<\/strong><\/pre>\n<pre><strong>upload_max_filesize = 10M<\/strong><\/pre>\n<p>\u3067\u3001\u5fd8\u308c\u3061\u3083\u3044\u3051\u306a\u3044\u306e\u304c\u518d\u8d77\u52d5\u3067\u3059\u3002<br \/>\n\u4eca\u5ea6\u306fphp-fpm\u3067\u3059\u306d\u3002<\/p>\n<pre><strong>sudo systemctl restart php-fpm<\/strong><\/pre>\n<p>\u306f\u3044\uff01\u3053\u308c\u3067PHP\u5074\u3082\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u3042\u3068\u306f<a href=\"https:\/\/pixabay.com\/ja\/\" target=\"_blank\" rel=\"noopener\">pixabay<\/a>\u306a\u3069\u3067\u3001\u3067\u304b\u3044\u753b\u50cf\u3067\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30fb\u30c6\u30b9\u30c8\u3092\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f(^^)<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u306e\u6d41\u308c\u3067PHP\uff08Laravel\uff09\u3092\u52d5\u304b\u3059\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306fapache\u3067\u306f\u306a\u304fnginx\uff08\u203b\u3048\u3093\u3058\u3093\u3048\u3063\u304f\u3059\u3002\u30ed\u30b7\u30a2\u88fd\uff09\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002 \u7406\u7531\u3068\u3057 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=256\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u30c1\u30a7\u30c3\u30af\u306f\uff13\u30f5\u6240\uff01 413 Request Entity Too Large\u304c\u8868\u793a\u3055\u308c\u305f\u6642\u306e\u5bfe\u51e6\u6cd5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":258,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[33,34],"class_list":["post-256","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-nginx","tag-34"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256"}],"version-history":[{"count":2,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions\/260"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/258"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}