application.yml 1.8 KB
Newer Older
M
ManongJu 已提交
1 2 3
spring:
  application:
    name: Gateway
M
ManongJu 已提交
4 5
  zipkin:
    base-url: http://10.10.8.2:9050
M
ManongJu 已提交
6
server:
M
ManongJu 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  port: 9030
eureka:
  instance:
    prefer-ip-address: true #使用IP注册
    instance-id: ${spring.cloud.client.ipAddress}:${server.port}
  client:
      service-url:
        defaultZone: http://register1:9010/eureka/,http://register2:9011/eureka/
###actuator监控点 start####
endpoints:
  health:
    sensitive: false
    enabled: true
##默认情况下很多端点是不允许访问的,会返回401:Unauthorized
management:
  security:
    enabled: false
M
ManongJu 已提交
24
###actuator监控点 end####
M
ManongJu 已提交
25

M
ManongJu 已提交
26
###如下Oauth2.0配置参考##
M
SSO  
ManongJu 已提交
27 28 29 30 31
###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 已提交
32 33 34
  host:
    connect-timeout-millis: 10000
    socket-timeout-millis: 60000
M
SSO  
ManongJu 已提交
35 36 37 38 39 40 41 42 43 44 45 46
  routes:
    uaa:
      path: /uaa/**
      strip-prefix: true
      sensitiveHeaders:
      serviceId: auth2.0-center
security:
  basic:
    enabled: false
  oauth2:
    client:
      access-token-uri: http://10.10.8.2:9030/uaa/oauth/token ##网关的地址
M
fixed  
ManongJu 已提交
47
      user-authorization-uri: http://10.10.8.2:9030/uaa/oauth/authorize
M
SSO  
ManongJu 已提交
48 49 50
    resource:
      user-info-uri:  http://10.10.8.2:9030/uaa/user
      prefer-token-info: false
M
ManongJu 已提交
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
##############end#####################
####超时配置####
ribbon:
  ReadTimeout: 10000
  ConnectTimeout: 10000
  MaxAutoRetries: 1
  MaxAutoRetriesNextServer: 2
  eureka:
    enabled: true
hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: true
        isolation:
          thread:
            timeoutInMilliseconds: 600000
###超时配置###