Railsでの設定か、nginxでの設定であるため、まずはnginxのエラーログを見る。
$ sudo less /var/log/nginx/error.log #最新のログを見たいので、shift + g で最新のログへ 2024/04/25 22:42:43 [error] 2878351#2878351: *2304 client intended to send too large body: 1055110 bytes, client: 133.204.66.129, server: 〇〇.com, request: "POST /wants HTTP/1.1", host: "〇〇.com", referrer: "https://〇〇.com/wants/new" ~
too large body: 1055110 bytes
というエラーがあるため、nginxの設定によるもの。
/etc/nginx/nginx.conf
のlocation内に以下を記述し20Mまで対応できるようにする。
server{ server_name 〇〇.com; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; location / { proxy_pass http://127.0.0.1:3500; client_max_body_size 20M; }
$ sudo service nginx restart
でnginxリスタート
これでOK。