简体   繁体   English

Traefik 中间件缓冲响应代码

[英]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.

相关问题 将 traefik 用作 DaemonSet 还是部署? - Using traefik as a DaemonSet or as a Deployment? 设置“response_mode 和 code_challenge_methods_supported - set "response_mode and code_challenge_methods_supported API 抛出错误的响应代码 500 内部错误而不是 204 - The API is throwing wrong response code 500 internal error instead 204 Laravel 9 生产邮件仅收到此错误 - 预期响应代码“250”但收到代码“451” - Laravel 9 mail on production get only this error - Expected response code "250" but got code "451" LAMBDA_RUNTIME 无法发布处理程序成功响应。 Http 响应码:413 - LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413 Android Studio:Firebase 云消息意外响应代码 401 - Android Studio : Firebase Cloud Messaging Unexpected response code 401 Traefik-ingress 仪表板返回 404 - Traefik-ingress dashboard return 404 在 kube.netes 上运行的 traefik AWS ELB 上的真实 IP - Real IP on traefik AWS ELB running on kubernetes 中间件 Firebase 认证说明 - Middleware Firebase authentication clarification Kube.netes (GCE/GKE) 上的 Traefik 支持 GCE 负载均衡器 - Traefik on Kubernetes (GCE/GKE) behind GCE Load Balancer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM