简体   繁体   中英

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 -

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

"Connection reset by peer (Write failed)"

Is there a way to intercept this response, and generate the expected HTTP response code instead?

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.

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.

Testing with Curl identified the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM