server:
  port: 80

# Spring 配置
spring:
  application:
    name: microservice-gateway
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
    gateway:
      discovery:
        locator:
          enabled: true
          lower-case-service-id: true
      routes:
        - id: user
          uri: lb://microservice-provider-user
          predicates:
            - Path=/user/**
            - Method=GET,POST
        - id: access
          uri: lb://microservice-provider-access
          predicates:
            - Path=/access/**
            - Method=GET,POST
        - id: shop
          uri: lb://microservice-provider-shop
          predicates:
            - Path=/shop/**
            - Method=GET,POST

        - id: test1
          uri: lb://microservice-provider-test
          predicates:
            - Path=/test/**,/test1/**
            - Method=GET,POST
          filters:
            - StripPrefix=1 # 跳过第一段 /test

        - id: test2
          uri: lb://microservice-provider-test
          predicates:
            - Path=/test2/{routes}
          filters:
            - SetPath=/hi/{routes}

        - id: test3
          uri: lb://microservice-provider-test
          predicates:
            - Path=/test3/**
          filters:
            - name: RedirectTo
              args:
                status: 302
                url: https://www.baidu.com/?wd=
