ITstudy

Nginx์™€ Apache Request Entity Too Large ์›์ธ๊ณผ ๋ฌธ์ œํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

martinooo 2024. 10. 21. 14:10

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ


Nginx, Apache๋กœ ์„œ๋ฒ„๋ฅผ ๊ตฌ์„ฑํ•˜๊ณ  ํ”„๋ก ํŠธ์—์„œ ์„œ๋ฒ„๋กœ ์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ ์šฉ๋Ÿ‰์ด ํฐ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๋ฉด 413 Request Entity Too Large ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณผ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด๋Ÿฌํ•œ ์˜ค๋ฅ˜์— ๋Œ€ํ•œ ์›์ธ์„ ํŒŒ์•…ํ•˜์ง€ ๋ชปํ•˜๋ฉด ๋ถˆํ•„์š”ํ•œ ์‹œ๊ฐ„๋‚ญ๋น„๋ฅผ ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Nginx

 

์ด ๊ธ€์„ ํ†ตํ•ด์„œ Request Entity Too Large ์›์ธ๊ณผ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์•Œ์•„๋‘๋ฉด ์ข‹์€ Nginx Proxy ์„ค์ • ์˜ค๋ฅ˜ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

2023.02.01 - [AWS] - [Trouble Shooting] Nginx proxy ์„ค์ •

 

[Trouble Shooting] Nginx proxy ์„ค์ •

๐Ÿคท‍โ™‚๏ธ Proxy? ๋‹ค๋ฅธ ์„œ๋ฒ„์—์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ์ฐพ๋Š” ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์— ๋Œ€ํ•œ ์ค‘๊ณ„์ž ์—ญํ• ์„ ํ•˜๋Š” ์„œ๋ฒ„์ด๋‹ค. ๋”ฐ๋ผ์„œ ํ”„๋ก์‹œ ์„œ๋ฒ„๋Š” ํด๋ผ์ด์–ธํŠธ์™€ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ฐพ๊ณ  ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ˜ธ์ŠคํŒ…ํ•˜๋Š” ์‹ค์ œ

cometruedream.tistory.com

 

๐Ÿคท‍โ™‚๏ธ Request Entity Too Large๋ž€?


Request Entity Too Large ์˜ค๋ฅ˜๋Š” ์›น ์„œ๋ฒ„๊ฐ€ ํด๋ผ์ด์–ธํŠธ๋กœ๋ถ€ํ„ฐ ์ „์†ก๋œ ์š”์ฒญ์˜ ํฌ๊ธฐ๊ฐ€ ์„œ๋ฒ„๊ฐ€ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ํ•œ๊ณ„๋ฅผ ์ดˆ๊ณผํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” HTTP ์ƒํƒœ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.

 

์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” 2๊ฐ€์ง€ ์ด์œ 

  1. ํŒŒ์ผ ์—…๋กœ๋“œ: ์‚ฌ์šฉ์ž๊ฐ€ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์ด๋ฏธ์ง€, ํŒŒ์ผ, ๋น„๋””์˜ค๋“ฑ ํฐ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•  ๋•Œ ์„œ๋ฒ„๊ฐ€ ์„ค์ •ํ•œ ์ตœ๋Œ€ ํŒŒ์ผ ํฌ๊ธฐ ์ œํ•œ์„ ์ดˆ๊ณผํ•˜๋ฉด ์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
  2. ๋Œ€๋Ÿ‰ ๋ฐ์ดํ„ฐ ์ „์†ก: ํ•œ ๋ฒˆ์— ๋งŽ์€ ์–‘์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๋ ค๊ณ  ํ•  ๋•Œ ์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

 

์™œ ์šฉ๋Ÿ‰์— ๋Œ€ํ•œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜๋Š”๊ฐ€?

Nginx, Apache ๋Œ€ํ‘œ์ ์ธ ์›น์„œ๋ฒ„๋กœ ๋ณด์•ˆ๊ณผ ์„ฑ๋Šฅ์„ ์ด์œ ๋กœ ์šฉ๋Ÿ‰์— ๋Œ€ํ•œ ํฌ๊ธฐ ์ œํ•œ์„ ๋‘ก๋‹ˆ๋‹ค.

  • ์„ฑ๋Šฅ ์ €ํ•˜: ํฐ ์š”์ฒญ์€ ์„œ๋ฒ„์˜ ๋ฆฌ์†Œ์Šค๋ฅผ ๋งŽ์ด ์†Œ๋ชจํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ์„œ๋ฒ„์˜ ์‘๋‹ต ์†๋„๊ฐ€ ๋Š๋ ค์ง€๊ฑฐ๋‚˜ ๋‹ค๋ฅธ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐ ์˜ํ–ฅ์„ ๋ฏธ์น  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์•ˆ์ •์„ฑ ๋ฌธ์ œ: ์„œ๋ฒ„๊ฐ€ ๋ฉ”๋ชจ๋ฆฌ ๋ถ€์กฑ ๋˜๋Š” ๊ณผ๋„ํ•œ CPU ์‚ฌ์šฉ์œผ๋กœ ์ธํ•ด ๋‹ค์šด๋  ์œ„ํ—˜์ด ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿคท‍โ™‚๏ธ Request Entity Too Large ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•?


์›น์„œ๋ฒ„์— client_max_body_size ์„ค์ • ๋•Œ๋ฌธ์— ํฐ ์šฉ๋Ÿ‰์„ ์„œ๋ฒ„์— ๋ณด๋‚ผ ๋•Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

client_max_body_size ๊ธฐ๋ณธ๊ฐ’์€ 1MB ํฌ๊ธฐ์ด๋ฉฐ ์›น์„œ๋ฒ„์— client_max_body_size ์„ค์ •์„ ๋ณ€๊ฒฝํ•จ์œผ๋กœ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๋ฐฉ๋ฒ•์€ ์—ฌ๋Ÿฌ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์ผ ๋ฟ์ด์ง€ ๊ฐ€์žฅ ์ข‹์€ ๋ฐฉ๋ฒ•์€ ์•„๋‹™๋‹ˆ๋‹ค.

 

Nginx์—์„œ "Request Entity Too Large" ์˜ค๋ฅ˜ ํ•ด๊ฒฐํ•˜๊ธฐ

1. Nginx ์„ค์ • ํŒŒ์ผ ์—ด๊ธฐ

sudo vi /etc/nginx/nginx.conf

 

2. ์„œ๋ฒ„ ๋ธ”๋ก ๋˜๋Š” http ๋ธ”๋ก์— ๋‹ค์Œ ์ค„ ์ถ”๊ฐ€

client_max_body_size 50M;  # ์›ํ•˜๋Š” ํฌ๊ธฐ๋กœ ์„ค์ • (์˜ˆ: 50MB)

 

3. Nginx ์žฌ์‹œ์ž‘

sudo systemctl restart nginx

 

Apache์—์„œ "Request Entity Too Large" ์˜ค๋ฅ˜ ํ•ด๊ฒฐํ•˜๊ธฐ

1. Apache ์„ค์ • ํŒŒ์ผ ์—ด๊ธฐ

sudo vi /etc/httpd/conf/httpd.conf

 

2. <Directory> ๋ธ”๋ก์ด๋‚˜ VirtualHost ๋ธ”๋ก์— ๋‹ค์Œ ์ค„ ์ถ”๊ฐ€

<Directory "/var/www/html">
    LimitRequestBody 52428800  # ์›ํ•˜๋Š” ํฌ๊ธฐ๋กœ ์„ค์ • (์˜ˆ: 50MB)
</Directory>

 

3. Apache ์žฌ์‹œ์ž‘

sudo systemctl restart apache2

 

 

๐Ÿคท‍โ™‚๏ธ Request Entity Too Large ๋งˆ์ง€๋ง‰์œผ๋กœ


Request Entity Too Large ์˜ค๋ฅ˜๋Š” ์›น ์„œ๋ฒ„์—์„œ ํ”ํžˆ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋Š” ์˜ค๋ฅ˜์ž…๋‹ˆ๋‹ค.

์›์ธ๊ณผ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์„ ์ž˜๋ชจ๋ฅธ๋‹ค๋ฉด ๋ฌธ์ œํ•ด๊ฒฐ์„ ์œ„ํ•ด์„œ ๋ถˆํ•„์š”ํ•œ ์‹œ๊ฐ„์„ ๋‚ญ๋น„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด ๊ธ€์„ ํ†ตํ•ด์„œ ์ด ์˜ค๋ฅ˜์— ์›์ธ๊ณผ ์›น์„œ๋ฒ„๋ฅผ ํ™œ์šฉํ•ด์„œ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค.

 

 

 

[์ฐธ๊ณ  ๋ฌธ์„œ]

https://dev.to/matthewlafalce/error-413-request-entity-too-large-in-nginx-516

 

Error: 413 “Request Entity Too Large” in Nginx

Why am I seeing Error: 413 “Request Entity Too Large” in Nginx? This is happening because...

dev.to

 


 

์žฌ๋ฐŒ๋Š” ์˜ค๋Š˜์˜ ๋ ๋ณ„ ์šด์„ธ ๋ณด๊ณ  ๊ฐ€์„ธ์š”! 

 

 

https://cometruedream.tistory.com/247

 

[React] Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผ className ์ปค์Šคํ…€

๐Ÿคท‍โ™‚๏ธ Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผํ”„๋กœ์ ํŠธ ์ง„ํ–‰์ค‘ ๋ฐฐ๋„ˆ ๋งํฌ์— URL ๊ธธ์ด๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด์„œ 3์ค„ ํšจ๊ณผ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. React + Tailwind CSS ์…‹ํŒ…๋œ ํ”„๋กœ์ ํŠธ ์—ฌ์„œ CSS ํŒŒ์ผ & style ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/243

 

NestJS Lifecycle (์ƒ๋ช…์ฃผ๊ธฐ) ๊ฐœ๋…

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ Nest JS ๊ฐœ๋…?Nest JS๋Š” Node JS ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์ƒ๋‹นํžˆ ์˜ค๋žซ๋™์•ˆ Express ๊ธฐ๋ฐ˜์œผ๋กœ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์—์„œ ์••๋„์ ์ธ ์ 

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/242

 

๋ฆฌ์•กํŠธ Vite Proxy ํ™œ์šฉํ•œ CORS ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋ก ํŠธ์—”๋“œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ต์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€๋ฅผ ํ•˜๊ณ  ๊ธ€์„ ๋ณด์‹œ๋ฉด ๋” ๋งŽ์€ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค^^ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ตhttps://comet

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/241

 

React ํด๋”๊ตฌ์กฐ FSD ๊ธฐ๋Šฅ ๋ถ„ํ™œ ์„ค๊ณ„ ์•„ํ‚คํ…์ฒ˜

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ ํด๋” ๊ตฌ์กฐ, ์„ค๊ณ„์— ๋Œ€ํ•œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์€ ์ƒ๋‹นํžˆ ์–ด๋ ต๋‹ค. ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์— React FSD ํด๋”๊ตฌ์กฐ ์•„ํ‚คํ…์ฒ˜๋ฅผ ์„ค๊ณ„ํ•  ์˜ˆ์ •์ด๋ผ์„œ FSD ์•„ํ‚คํ…

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/244

 

์‰ฝ๊ฒŒ ์ดํ•ดํ•˜๊ณ  ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋Š” Prisma ๋ช…๋ น์–ด ์ •๋ฆฌ

๐Ÿคท‍โ™‚๏ธ Prisma ๋ช…๋ น์–ด ๋ณธ๋ก ์— ์•ž์„œ Prisma๋ž€?Nest JS ํ”„๋ ˆ์ž„์›Œํฌ์™€ Prisma ORM์„ ํ™œ์šฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ Prisma๋Š” Node JS ๊ธฐ๋ฐ˜์— ํ”„๋ ˆ์ž„์›Œํฌ/๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ์ƒํ˜ธ์ž‘์šฉ์ด ์ž˜๋˜๋ฉฐ Prisma + DB ์—ฐ๋™์œผ

cometruedream.tistory.com