bootstrap.yml 1.1 KB
Newer Older
1 2
#端口号
server:
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  port: 8089

management:
  endpoint:
    health:
      show-details: always
  endpoints:
    jmx:
      exposure:
        include: '*'
    web:
      exposure:
        include: '*'
  health:
    sentinel:
      enabled: false
19 20 21 22

#spring配置
spring:
  application:
23
    name: nacos-server-gateway
24 25 26
  profiles:
    active: dev
  cloud:
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    gateway:
      enabled: true #开启网关
      discovery:
        locator:
          enabled: true  #启用DiscoveryClient
      routes:
        - id: route1
          uri: lb://nacos-server-consumer
          predicates:
            - Path=/nacos/consumer/test,/nacos/consumer/index
        - id: route2
          uri: lb://nacos-server-producer
          predicates:
            - Path=/service/**
          filter:
            - AddRequestHeader=X-Request-Id,12345

44 45 46
    nacos:
      discovery:
        server-addr: http://120.79.36.53:8848   #服务注册地址
47 48
        username: nacos
        password: nacos
49 50 51
    sentinel:
      transport:
        dashboard: 127.0.0.1:8181
52
        port: 8719  #默认端口,如果被占用则从8719依次+1扫描