Spring Cloud 注解说明

context-path: /uaa:#认证服务上下文地址(必须配置)

uaa配置

spring:
  application:
      name: secu-oauth
  cloud:
    config:
      discovery:
        service-id: config-server
        enabled: true
      profile: dev
      name: ${spring.application.name}, db-config
  redis:
    host: localhost
    port: 6379
  mvc: 
    view: 
      prefix: classpath:/templates/
      suffix: .html 
server:
  port: 8763
  servlet: 
   context-path: /uaa   #认证服务上下文地址(必须配置)
  
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
      

#logging:
#  config: classpath:log4j2.xml
#feign:
#  hystrix:
#    enabled: false
  

zuul配置

spring:
  application:
      name: zuul-server
  cloud:
    config:
      discovery:
        service-id: config-server
        enabled: true
      profile: dev
      name: ${spring.application.name},oauth2-api,db-config

server:
  port: 8767
  
zuul:
  routes:
    uaa:
      path: /uaa/**
      sensitiveHeaders: "*"
      serviceId: secu-oauth
#    order:
#      path: /accounts/**
#      sensitiveHeaders: "*"
#      serviceId: account-service
  add-proxy-headers: true

security:
  basic:
    enabled: false 
  oauth2: 
#   sso: 
#    loginPath: /login
   client: 
    accessTokenUri: http://localhost:8767/uaa/oauth/token
    userAuthorizationUri: http://localhost:8767/uaa/oauth/authorize
    clientId: android
    clientSecret: android
   resource:
      id: zuul-server
      user-info-uri: http://localhost:8767/uaa/user
      prefer-token-info: false

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值