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

gateway1

[MSA / Spring Cloud] Spring Cloud MSA ํ”„๋กœ์ ํŠธ์—์„œ CORS ์„ค์ •์— ๋Œ€ํ•ด (feat. 403 error) ๋ถ€ํŠธ์บ ํ”„ ํ”„๋กœ์ ํŠธ์˜ "๋™์ƒ์ด๋†"์—์„œ Spring Cloud ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์ด์šฉํ•˜์—ฌ MSA ํ”„๋กœ์ ํŠธ ์„ธํŒ…์„ ๋งก์•˜๋Š”๋ฐ์š”์ œ๊ฐ€ MSA ์„ธํŒ…์„ ํ•˜๋ฉฐ CORS ์„ค์ •์— ๋Œ€ํ•ด ๋†“์ณค๋˜ ๋ถ€๋ถ„๊ณผ ์ƒˆ๋กญ๊ฒŒ ์•Œ๊ฒŒ๋œ ๊ฒƒ์— ๋Œ€ํ•ด ํฌ์ŠคํŒ…ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋™์ƒ์ด๋†์˜ MSA ์•„ํ‚คํ…์ฒ˜๋™์ƒ์ด๋† ํ”„๋กœ์ ํŠธ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ MSA ๊ตฌ์กฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.8081 ํฌํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” vue ํ”„๋กœ์ ํŠธ๊ฐ€ 8080 ํฌํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” API Gateway์—๊ฒŒ ์š”์ฒญ์„ ๋ณด๋‚ด๋ฉดAPI Gateway๋Š” ์„œ๋น„์Šค ๋””์Šค์ปค๋ฒ„๋ฆฌ ์—ญํ• ์„ ํ•˜๋Š” Eureka ์„œ๋ฒ„๋ฅผ ํ†ตํ•ด ๊ฐ ๋ชจ๋“ˆ์˜ IP, Port ์ •๋ณด๋ฅผ ์•Œ์•„๋‚ด๊ณ  ์ ์ ˆํ•œ ๊ณณ์œผ๋กœ ๋ผ์šฐํŒ…ํ•˜๋Š” ๊ฒƒ์ด์ฃ .(API gateway์™€ Eureka๋ฅผ ์ œ์™ธํ•œ ์„œ๋ฒ„๋“ค์€ ์œ ๋™ํฌํŠธ๋ฅผ ์“ฐ๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, Eureka๋ฅผ ํ†ตํ•ด IP, Port๋ฅผ ์•Œ์•„๋‚ด๋Š” .. 2024. 10. 3.