프로젝트에서 하나의 서버에 1개 이상의 Path를 사용중이라 Spring Cloud Gateway에서 설정이 필요
#########
spring:
main:
web-application-type: reactive
allow-bean-definition-overriding: true
application:
name: gateway-server
cloud:
gateway:
routes:
- id: auth-server
uri: lb://auth-server
predicates:
- Path=/api/users/**
- id: company-server
uri: lb://company-server
predicates:
- Path=/api/companies/**
- Path=/api/products/**
discovery:
locator:
enabled: true
#########
Path 작성 부분에서 ,로 구분해서 작성
#########
spring:
main:
web-application-type: reactive
allow-bean-definition-overriding: true
application:
name: gateway-server
cloud:
gateway:
routes:
- id: auth-server
uri: lb://auth-server
predicates:
- Path=/api/users/**
- id: company-server
uri: lb://company-server
predicates:
- Path=/api/companies/**, /api/products/**
discovery:
locator:
enabled: true
#########
결과
정상 작동 확인