使用docker部署springCloud应用的时候,我们会使用到网关gateway,但是在使用的时候会出现各种问题,如标题所示,出现这种问题的原因很多,一半比较简单的,按照下面配置就没问题了,配置如下:
spring:
application:
name: platform-gateway
# cloud:
# config:
# discovery:
# enabled: true
# service-id: CONFIG
# profile: dev
server:
port: 8083
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka
instance:
prefer-ip-address: true
zuul:
routes:
# platform-config可以随便命名
platform-config:
path: /config/**
serviceId: config
# 设置cookie可以传到服务器
sensitiveHeaders:
host:
max-total-connections: 500
max-per-route-connections: 50
ribbon:
ReadTimeout: 6000
ConnectTimeout: 6000
eureka:
enabled: true
management:
security:
enabled: false
hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
strategy: THREAD
thread:
timeoutInMilli