当发布通过Spring Cloud Gateway路由的内容时,我当前收到的413请求实体太大。当请求正文不超过3MB左右时,它就会起作用。
这是我的application.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入口控制器上。我修复了那里的问题,现在它正在工作
发布于 2021-09-28 09:51:27
它只比较指定限制的Content-Length请求头部,并立即拒绝,即不计算上传的字节
https://stackoverflow.com/questions/65910046
复制相似问题