我目前得到一个413请求实体太大时,张贴的东西路由通过一个Spring云网关。当请求正文不大于3MB时,它可以工作。
这是我的申请表。yml(擦洗)spring:
profiles:
active: prod
main:
allow-bean-definition-overriding: true
application:
name: my-awesome-gateway
cloud:
gateway:
default-filters:
- DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_UNIQUE
routes:
- id: my-service
uri: https://myservicesdomainname
predicates:
- Path=/service/**
filters:
- StripPrefix=1
- UserInfoFilter
- name: Hystrix
args:
name: fallbackCommand
fallbackUri: forward:/fallback/first
- name: RequestSize
args:
maxSize: 500000000 #***** Here is my attempt to increase the size
httpclient:
connect-timeout: 10000
response-timeout: 20000
这是我从
得到的RequestSize/args/maxSize的链接https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.1.0.RELEASE/multi/multi__gatewayfilter_factories.html#_requestsize_gatewayfilter_factory
编辑:问题出在Kubernetes入口控制器上。我修复了那里的问题,现在它正在工作
它只比较内容长度请求头与指定的限制,并立即拒绝,即它不计算上传的字节