[英]Traefik Middleware Buffering Response Code
We have a global buttering middleware rule applied to Traefik v2.9.6 running inside EKS v1.23 as seen here -我们在 EKS v1.23 中运行的 Traefik v2.9.6 应用了全局 buttering 中间件规则,如下所示 -
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: request-limits
spec:
buffering:
maxRequestBodyBytes: 10485760
And this is applied via -这是通过 -
additionalArguments:
- --entrypoints.websecure.http.middlewares=traefik-request-limits@kubernetescrd
The 10 MiB limit works, but the expected HTTP 413 response is not returned, instead the response is 10 MiB 限制有效,但未返回预期的 HTTP 413 响应,而是响应
"Connection reset by peer (Write failed)"
Is there a way to intercept this response, and generate the expected HTTP response code instead?有没有办法拦截此响应,并生成预期的 HTTP 响应代码?
The issue has nothing to do either either EKS or Traefik, it had to do with the client making the REST API request into the cluster.这个问题与 EKS 或 Traefik 无关,它与客户端向集群发出 REST API 请求有关。
The version of the Java JDK on the client host was causing the connections to be terminated prematurely before the server side response, which should have been a HTTP 413.客户端主机上的 Java JDK 版本导致连接在服务器端响应之前过早终止,这应该是 HTTP 413。
Testing with Curl identified the issue.用 Curl 测试确定了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.