LoginSignup
0
0

More than 1 year has passed since last update.

画像投稿で413エラーが出た時

Last updated at Posted at 2021-09-05

サイズ6.2Mの画像を投稿しようとすると413エラーが発生
20200526235206.jpeg

原因

アップロードしようとしているファイルの大きさが、nginxで設定している最大アップロードサイズを超えているため。

確認すると・・・

[ec2-user@ip-**-*-*-*** ~]$ sudo vi /etc/nginx/nginx.conf

自分は何故かアップロードサイズの設定をしていませんでした

http {
 省略

    server {
   省略
    }
}

解決

以下で最大10Mのサイズまで画像を投稿できるようになりました:clap:

http {
  client_max_body_size 10M; #ここを記述
 省略

    server {
   省略
    }
}

再起動して設定を反映させる

[ec2-user@ip-**-*-*-*** ~]$sudo nginx -s reload
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0