카테고리 없음

api gateway application.yml 설정 예시

jw-backend 2024. 7. 1. 20:29
반응형
server:
  port: 5000  # 게이트웨이가 실행될 포트

spring:



  cloud:
    gateway:
      routes:
        - id: example_route
          uri: http://localhost:8081  # 실제 백엔드 서비스의 URL
          predicates:
            - Path=/service/**
          filters:
            - StripPrefix=1
            - name: AuthHeaderFilter  # 커스텀 필터 사용


        - id: login_reigster_route
          uri: http://localhost:8080  # 로그인 요청을 처리할 백엔드 서비스의 URL
          predicates:
            - Path=/public/**
          filters:
            - StripPrefix=1
#          filters: [ ]  # 필터 없음

logging:
  level:
    org.springframework.cloud.gateway: DEBUG  # 디버그 로그 레벨 설정