application.yml 1.9 KB
Newer Older
M
ManongJu 已提交
1 2
spring:
  application:
M
ManongJu 已提交
3
    name: mss-gateway
M
ManongJu 已提交
4
  zipkin:
M
ManongJu 已提交
5
    base-url: http://localhost:9050
M
ManongJu 已提交
6
server:
M
ManongJu 已提交
7 8 9 10 11
  port: 9030
eureka:
  instance:
    prefer-ip-address: true #使用IP注册
    instance-id: ${spring.cloud.client.ipAddress}:${server.port}
M
ManongJu 已提交
12 13 14 15
    ##续约更新时间间隔设置5秒,m默认30s
    lease-renewal-interval-in-seconds: 5
    ##续约到期时间10秒,默认是90秒
    lease-expiration-duration-in-seconds: 10
M
ManongJu 已提交
16 17
  client:
      service-url:
M
ManongJu 已提交
18
        defaultZone: http://mss-eureka1:9010/eureka/,http://mss-eureka2:9011/eureka/
M
ManongJu 已提交
19 20 21 22 23 24 25 26 27
###actuator监控点 start####
endpoints:
  health:
    sensitive: false
    enabled: true
##默认情况下很多端点是不允许访问的,会返回401:Unauthorized
management:
  security:
    enabled: false
M
ManongJu 已提交
28
###actuator监控点 end####
M
ManongJu 已提交
29

M
ManongJu 已提交
30
###如下Oauth2.0配置参考##
M
SSO  
ManongJu 已提交
31 32 33 34 35
###https://stackoverflow.com/questions/30327269/spring-oauth-authorization-server-behind-spring-cloud-zuul-proxy##
###https://github.com/spring-guides/tut-spring-security-and-angular-js/blob/master/oauth2-vanilla/README.adoc##
###http://wiselyman.iteye.com/blog/2379419##
#######
zuul:
M
ManongJu 已提交
36 37 38
  host:
    connect-timeout-millis: 10000
    socket-timeout-millis: 60000
M
SSO  
ManongJu 已提交
39 40 41 42 43 44 45 46 47 48 49
  routes:
    uaa:
      path: /uaa/**
      strip-prefix: true
      sensitiveHeaders:
      serviceId: auth2.0-center
security:
  basic:
    enabled: false
  oauth2:
    client:
M
ManongJu 已提交
50 51
      ##网关的地址
      access-token-uri: http://localhost:9030/uaa/oauth/token
M
ManongJu 已提交
52
      user-authorization-uri: http://localhost:9030/uaa/oauth/authorize
M
SSO  
ManongJu 已提交
53
    resource:
M
ManongJu 已提交
54
      user-info-uri:  http://localhost:9030/uaa/user
M
SSO  
ManongJu 已提交
55
      prefer-token-info: false
M
ManongJu 已提交
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
##############end#####################
####超时配置####
ribbon:
  ReadTimeout: 10000
  ConnectTimeout: 10000
  MaxAutoRetries: 1
  MaxAutoRetriesNextServer: 2
  eureka:
    enabled: true
hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: true
        isolation:
          thread:
            timeoutInMilliseconds: 600000
###超时配置###