【nginx】413 request entity too largeのnginxエラー解消

カテゴリ:nginx 投稿:2022年6月4日22:10、更新:2022年6月27日1:28

・記事の概要 

画像アップロード処理などで「413 request entity too large」が発生した場合の解消手順を記載します。


・この記事でできるようになること 

「413 request entity too large」を解消し、任意のサイズのファイルを正常にアップロードできるようになります。

nginxではデフォルトだと1MBまでのデータしか受け付けないので設定を変えていきます。


・実際の手順 

nginx.confの編集

/etc/nginx/nginx.conf」を編集し

sever{}内にclient_max_body_sizeを追記します。5M部分は任意のサイズで良いです。

server {

  listen       80;

  client_max_body_size 5M;


②設定を反映

reloadで設定を反映させます。

service nginx reload


・まとめ 

いかがだったでしょうか。

容量は無限に大きくしてしまうとシステム要件上、負荷がかかりすぎるなどの問題にもなり得るので適当に上げすぎることにはご注意ください。


コメント一覧

名無し / 2023年9月13日7:33
123456

名無し / 2023年9月13日7:39
123456
expr 809739708 + 800269927

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456|expr 809750381 + 906913025

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456$(expr 830934954 + 802197829)

/*1*/{{889499143+865876396}} / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456

${@var_dump(md5(804898729))}; / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456&set /A 884713672+914026456

${967072518+950407829} / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456'and/**/extractvalue(1,concat(char(126),md5(1567916290)))and'

名無し / 2023年9月13日7:39
123456

'-var_dump(md5(342358221))-' / 2023年9月13日7:39
123456

${935568456+830883071} / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456/**/and+4=4

名無し / 2023年9月13日7:39
expr 945920016 + 955343087

${(985849361+836079218)?c} / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456"and/**/extractvalue(1,concat(char(126),md5(1911642291)))and"

名無し / 2023年9月13日7:39
${@var_dump(md5(570150189))};

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
${855331782+978302314}

名無し / 2023年9月13日7:39
123456/**/and+1=8

名無し / 2023年9月13日7:39
extractvalue(1,concat(char(126),md5(1965987702)))

名無し / 2023年9月13日7:39
'-var_dump(md5(363039217))-'

名無し / 2023年9月13日7:39
123456'and'c'='c

<%- 964505516+828883248 %> / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456'and(select'1'from/**/cast(md5(1675246960)as/**/int))>'0

名無し / 2023年9月13日7:39
123456'and'd'='f

名無し / 2023年9月13日7:39
/*1*/{{976933738+840419806}}

名無し / 2023年9月13日7:39
123456/**/and/**/cast(md5('1322530269')as/**/int)>0

名無し / 2023年9月13日7:39
123456"and"v"="v

名無し / 2023年9月13日7:39
${978275047+899581258}

名無し / 2023年9月13日7:39
convert(int,sys.fn_sqlvarbasetostr(HashBytes('MD5','1748555820')))

名無し / 2023年9月13日7:39
123456"and"l"="a

名無し / 2023年9月13日7:39
${(871802174+989863944)?c}

名無し / 2023年9月13日7:39
123456'and/**/convert(int,sys.fn_sqlvarbasetostr(HashBytes('MD5','1760455697')))>'0

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
#set($c=863322161+843243948)${c}$c

名無し expr 826825531 + 841700004 / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456鎈'"\(

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
<%- 949082046+871168302 %>

名無し|expr 855025369 + 958701199 / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456'"\(

名無し / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
(select*from(select+sleep(0)union/**/select+1)a)

名無し&set /A 960048610+916349993 / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
(select*from(select+sleep(2)union/**/select+1)a)

expr 945536117 + 888145211 / 2023年9月13日7:39
123456

名無し / 2023年9月13日7:39
123456'and(select*from(select+sleep(0))a/**/union/**/select+1)='

名無し / 2023年9月13日7:39
123456'and(select*from(select+sleep(2))a/**/union/**/select+1)='

名無し / 2023年9月13日7:39
123456"and(select*from(select+sleep(0))a/**/union/**/select+1)="

名無し / 2023年9月13日7:39
123456"and(select*from(select+sleep(2))a/**/union/**/select+1)="

名無し / 2023年9月13日7:39
123456/**/and(select+1/**/from/**/pg_sleep(0))>0/**/

名無し / 2023年9月13日7:39
123456/**/and(select+1/**/from/**/pg_sleep(2))>0/**/

名無し / 2023年9月13日7:40
123456'/**/and(select'1'from/**/pg_sleep(0))::text>'0

名無し / 2023年9月13日7:40
123456'/**/and(select'1'from/**/pg_sleep(2))::text>'0

名無し / 2023年9月13日7:40
123456/**/and(select+1)>0waitfor/**/delay'0:0:0'/**/

名無し / 2023年9月13日7:40
123456/**/and(select+1)>0waitfor/**/delay'0:0:2'/**/

名無し / 2023年9月13日7:40
123456'and(select+1)>0waitfor/**/delay'0:0:0

名無し / 2023年9月13日7:40
123456'and(select+1)>0waitfor/**/delay'0:0:2

名無し / 2023年9月13日7:40
123456/**/and/**/1=DBMS_PIPE.RECEIVE_MESSAGE('k',0)

名無し / 2023年9月13日7:40
123456/**/and/**/1=DBMS_PIPE.RECEIVE_MESSAGE('z',2)

名無し鎈'"\( / 2023年9月13日7:40
123456

名無し / 2023年9月13日7:40
123456'/**/and/**/DBMS_PIPE.RECEIVE_MESSAGE('f',0)='f

名無し'"\( / 2023年9月13日7:40
123456

名無し / 2023年9月13日7:40
123456'/**/and/**/DBMS_PIPE.RECEIVE_MESSAGE('x',2)='x

名無し'and'v'='v / 2023年9月13日7:41
123456

名無し'and'b'='p / 2023年9月13日7:41
123456

名無し"and"a"="a / 2023年9月13日7:41
123456

名無し"and"x"="a / 2023年9月13日7:41
123456

コメント投稿ページへ


書いている人

のぎ
PG->SE->PMとして働き、現在はIT企業で新卒採用の担当をしています。長期育休取得明けで0歳娘の対応に毎日バタバタです。笑
採用業務をしつつ社内利用ツールなど作成しており、当ブログも勉強の一環でコーディングして作成しています。 エンジニア領域、人事・採用領域、育児関連など発信していきます。