๊ฐœ๋ฐœ์ผ์ง€-15 ๐Ÿ”ฅ[๋ฉ”๋‰ด ๋“ฑ๋ก 413์—๋Ÿฌ]

๊น€์„ฑ์ธยท2023๋…„ 9์›” 13์ผ
0

๋ฌธ์ œ

์œผ์•™(ํ—ˆ๋™์˜) ์นœ๊ตฌ๊ฐ€ ๋ฉ”๋‰ด API ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๋‹ค๊ฐ€ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค๊ณ  ํ•œ๋‹ค.
์›์ธ๊ณผ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ€์ง€๊ณ  ์™”๋Š”๋ฐ ์‹ค์ œ๋กœ ํ™•์ธํ•ด๋ณด๋‹ˆ ๋ฌธ์ œ๊ฐ€ ๋งž์•˜๋‹ค.
์„œ๋ฒ„ ๋กœ๊ทธ์—์„œ๋„ 413 Request Entity Too Large ์˜ค๋ฅ˜๊ฐ€ ์ฐํ˜”๊ณ , ํด๋ผ์ด์–ธํŠธ-์„œ๋ฒ„๋กœ ์š”์ฒญ ์‹œ์— ๋„˜์–ด์˜ค๋Š” ๋ฐ”๋”” ๊ฐ’์˜ ํฌ๊ธฐ๊ฐ€ ์ œํ•œ๋œ ํฌ๊ธฐ๋ณด๋‹ค ํด๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜ ์ฝ”๋“œ์˜€๋‹ค.


์›์ธ ๋ฐ ํ•ด๊ฒฐ

  • nginx์˜ default ๋ฐ”๋”” ์šฉ๋Ÿ‰ ์ œํ•œ์€ 1MB๋ผ๊ณ  ํ•œ๋‹ค.
    ๋™์˜ ์นœ๊ตฌ์˜ ๊ณ ์ƒ๋•๋ถ„์— ๋‚ด ๊ณ ์ƒ์„ ์กฐ๊ธˆ ๋œ์„ ์ˆ˜ ์žˆ์—ˆ์ง€๋งŒ, ์ด๋Ÿฐ ๋ถ€๋ถ„์€ ๋ฏธ๋ฆฌ ํŒŒ์•…ํ•ด์„œ ํ˜‘์˜๋ฅผ ์ž˜ ํ•ด์•ผํ•  ๋“ฏํ•˜๋‹ค..
//nginx.conf
http{
	client_max_body_size 50M;
}
  • SpringBoot ์„ค์ • ํŒŒ์ผ์—๋„ ์ตœ๋Œ€ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

์ฐธ๊ณ  ๋ธ”๋กœ๊ทธ

nginx.conf ์„ค์ • : https://joanne.tistory.com/269
SpringBoot ์„ค์ • ํŒŒ์ผ : https://velog.io/@jinho_pca/Spring-Boot-%ED%8C%8C%EC%9D%BC-%EC%97%85%EB%A1%9C%EB%93%9C-%EC%9A%A9%EB%9F%89%EC%A0%9C%ED%95%9C-%EC%84%A4%EC%A0%95

profile
๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฟˆ์ธ 25์‚ด ๋Œ€ํ•™์ƒ์ž…๋‹ˆ๋‹ค.

0๊ฐœ์˜ ๋Œ“๊ธ€