๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Server

[nginx, nexus docker repository] retrying, Request Entity Too Large ์—๋Ÿฌ ํ•ด๊ฒฐ

by LasBe 2024. 11. 18.
๋ฐ˜์‘ํ˜•

๐Ÿ“’ [nginx, nexus docker repository] retrying, Request Entity Too Large ์—๋Ÿฌ ํ•ด๊ฒฐ


๊ฐœ์ธ ์„œ๋ฒ„์— Nexus Docker Repository๋ฅผ ๊ตฌ์ถ•ํ•˜๊ณ  image push ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ดค๋Š”๋ฐ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

 

 

์ˆ˜ ๋ฒˆ์˜ ์žฌ์‹œ๋„ ๋์— Request Entity Too Large๋ผ๋Š” ์—๋Ÿฌ๋ฅผ ๋ฑ‰๊ณ  ๊ฒฐ๊ตญ ์ด๋ฏธ์ง€ ํ‘ธ์‹œ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.

 

๊ตฌ๊ธ€๋ง์„ ํ•˜๋˜ ๋์— Nexus ์„œ๋ฒ„์˜ ๋ฌธ์ œ๊ฐ€ ์•„๋‹Œ ์•ž ๋‹จ์— proxy๋กœ ๋‘์—ˆ๋˜ Nginx ๋ฌธ์ œ๋ผ๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

 

๐Ÿ“Œ Nginx ๋กœ๊ทธ ํ™•์ธ

$ docker logs -f proxy

๋กœ๊ทธ๋กœ ํ™•์ธํ•ด๋ณด๋‹ˆ Nginx์—์„œ client intended to send too large chunked body๋ผ๋Š” ์—๋Ÿฌ๋ฅผ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.

 

์ด ์˜ค๋ฅ˜๋Š” ํด๋ผ์ด์–ธํŠธ๊ฐ€ ๋ณด๋‚ด๋Š” ์š”์ฒญ ๋ณธ๋ฌธ(body)์ด Nginx ์„œ๋ฒ„์—์„œ ์„ค์ •๋œ ์ตœ๋Œ€ ํฌ๊ธฐ ์ œํ•œ์„ ์ดˆ๊ณผํ–ˆ์„ ๋•Œ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

 

๐Ÿ”Ž ํ•ด๊ฒฐ

/etc/nginx/nginx.conf ํŒŒ์ผ์— ๋‹ค์Œ ๊ตฌ๋ฌธ์„ ์ถ”๊ฐ€ํ•ด์ค๋‹ˆ๋‹ค.

์ €๋Š” ํ˜น์‹œ ๋ชฐ๋ผ ํ†ตํฌ๊ฒŒ 500M๋กœ ์„ค์ •ํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

sendfile                on;
client_max_body_size    500M;
client_body_buffer_size 500M;

 

sendfile ๊ตฌ๋ฌธ์ด ๊ธฐ์กด์— ์žˆ๋‹ค๋ฉด ์ค‘๋ณต๋์„ ๋•Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜๋‹ˆ ์กฐ์‹ฌํ•ด์ฃผ์„ธ์š”.

 

$ nginx -t #nginx ํ…Œ์ŠคํŠธ
$ service nginx reload #์ˆ˜์ •๋œ ํŒŒ์ผ ์ ์šฉ

์œ„ ๋ช…๋ น์–ด๋กœ ์ˆ˜์ •๋œ ํŒŒ์ผ์„ ๋ฐ˜์˜ํ•ด์ฃผ๋ฉด ๋์ž…๋‹ˆ๋‹ค.

 

 

์ •์ƒ์ ์œผ๋กœ push ๋œ ํ›„ ์ €์žฅ์†Œ์— ์„ฑ๊ณต์ ์œผ๋กœ ์ €์žฅ๋œ ๋ชจ์Šต์„ ํ™•์ธ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€


์˜คํ”ˆ ์ฑ„ํŒ