Spring Cloud Gateway中的常见配置

问题

最近用到了Spring Cloud Gateway,这里记录一下这个服务的常见配置。

yaml 复制代码
spring:
  data:
    redis:
      host: ${REDIS_HOST:xxx.xxx.xxx.xxx}
      port: ${REDIS_PORT:2345wsd}
      password: ${REDIS_PASS:sdfsdfgh}
      database: ${REDIS_DB:8}
  session:
    redis:
      flush-mode: on_save
      namespace: mysystem:session
    timeout: P30D
  cloud:
    gateway:
      discovery:
        locator:
          # 服务名小写
          lower-case-service-id: true
          enabled: true
      routes:
        # 服务1
        - id: auth-svc
          uri: lb://auth-svc
          predicates:
            - Path=/auth/**
          filters:
            - StripPrefix=1
        # 服务2
        - id: system-svc
          uri: lb://system-svc
          predicates:
            - Path=/system/**
          filters:
            - StripPrefix=1
相关推荐
zl97989931 分钟前
SpringBoot-数据访问之MyBatis与Redis
java·spring boot·spring
杨DaB2 小时前
【SpringCloud】回顾微服务
spring·spring cloud·微服务
lang201509283 小时前
Spring Boot集成Spring Integration全解析
spring boot·后端·spring
大G的笔记本4 小时前
Spring IOC和AOP
java·后端·spring
hello 早上好5 小时前
解析 Prompt 工程中的四大核心角色
spring
兮动人9 小时前
Spring中@Configuration注解的proxyBeanMethods属性详解
java·后端·spring
AWS官方合作商9 小时前
在AWS S3上动态自定义图片尺寸:Lambda + API Gateway无服务器解决方案
serverless·gateway·aws
Jing_jing_X10 小时前
Spring 自动注入是怎么实现的?从 @Component 到 @Autowired 的完整流程
java·后端·spring
李昊哲小课12 小时前
spring 中 HttpStatus 与 ResponseEntity
spring boot·后端·spring·http·spring cloud·restful