application.yml 2.4 KB
spring:
  redis:
    host: 192.168.1.53
    port: 6379
    timeout: 60000
  application:
    name: gateway-server-v11
  profiles:
    active: dev
  main:
    allow-bean-definition-overriding: true
  cloud:        # spring cloud gateway 路由配置方式
    gateway:
      discovery:      #是否与服务发现组件进行结合,通过 serviceId(必须设置成大写) 转发到具体的服务实例。默认为false,设为true便开启通过服务中心的自动根据 serviceId 创建路由的功能。
        locator:      #路由访问方式:http://Gateway_HOST:Gateway_PORT/大写的serviceId/**,
          lower-case-service-id: true     #其中微服务应用名默认大写访问,设置此属性可小写访问。
          enabled: true                   #gateway生成默认的routes,true生成,false,不生成
      routes:
  http:
    encoding:
      enabled: true
#        - id: ORDER-SERVICE           #网关路由到订单服务order-service
#          uri: lb://ORDER-SERVICE     #//后必须跟注册中心服务名称,表示跳转服务
#          predicates:
#            - Path=/order/**
#        - id: USE-SERVICE            #网关路由到用户服务user-service
#          uri: lb://USE-SERVICE
#          predicates:
#            - Path=/use/**
#        - id: nmms
#          uri: lb://WLPT-NMMS
#          predicates:
#            - Path=/nmms/**
#          filters:
#            - StripPrefix=1
#        - id: awba-server
#          uri: lb://awba-server
#          predicates:
#            - Path=/awb/**
#          filters:
#            - StripPrefix=1
server:
  port: 12343

eureka:
  client:
    service-url:
      defaultZone: http://192.168.1.53:12345/eureka/
#      defaultZone: http://10.5.10.78:12345/eureka/
    healthcheck:
      enabled: true
#  instance:
#    #eureka服务器页面中status的请求路径
#    status-page-url:  http://${eureka.instance.hostname}:${server.port}/index
#    prefer-ip-address: true
#    instance-id:  ${spring.cloud.client.ip-address}:${server.port}
#    hostname: ${spring.cloud.client.ip-address}
#    lease-renewal-interval-in-seconds: 15
#    lease-expiration-duration-in-seconds: 45

#日志配置
logging:
  config: config/logback-dev.xml
logback:
  appname: gateway-service
  logdir: ./log
# 暴露端点
management:
  endpoints:
    web:
      exposure:
        include: '*'
  endpoint:
    health:
      show-details: always
debug: false