skip to Main Content

We have the page which has some of the larger Javascript files. When we hit the page, all the small files get downloaded. However, one of the large files was not downloaded fully and failed with net::ERR_HTTP2_PROTOCOL_ERROR most of the time. We need to open the page using only a VPN connection as it does not open to all.

Just to add, the Nginx ingress controller is used with the following settings for that ingress:

    nginx.ingress.kubernetes.io/configuration-snippet: |
      gzip on;
      gzip_types text/plain text/css image/png application/javascript;
      if ($request_uri ~* .(js|css|gif|jpeg|png)) {
        expires 1M;
        add_header Cache-Control "public";
      }
    nginx.ingress.kubernetes.io/http2-push-preload: "false"
    nginx.ingress.kubernetes.io/proxy-body-size: 500M
    nginx.ingress.kubernetes.io/proxy-bufferings: "off"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "36000"
    nginx.ingress.kubernetes.io/proxy-max-temp-file-size: "0"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "36000"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "36000"
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/secure-backends: "true"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"

Can we set another annotation in the Nginx ingress or this might be an issue from VPN? I wonder how can we resolve this issue.

2

Answers


  1. Chosen as BEST ANSWER

    I solved this by changing the configuration for the Nginx Ingress as following:

    data:
      client-max-body-size: 50M
      keep-alive: "3600"
      proxy-buffer-size: 500m
      proxy-buffers-number: "8" 
    

    Glad if this is time-saving for anyone.


  2. As @DevOps answered this needs to be configured for nginx. The nginx kubernetes ingress has the option to be configured via a configmap where it supports many options.

    Here is an example for kubectl

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: ingress-nginx-controller
      namespace: ingress-nginx
      labels:
        app.kubernetes.io/name: ingress-nginx
        app.kubernetes.io/part-of: ingress-nginx
    data:
        client-max-body-size: "32M"
        proxy-buffer-size: "32M"
    

    Or with terraform

    resource "kubernetes_config_map" "ingress-nginx-controller" {
      metadata {
        name      = "ingress-nginx-controller"
        namespace = "ingress-nginx"
        labels = {
          "app.kubernetes.io/name"    = "ingress-nginx"
          "app.kubernetes.io/part-of" = "ingress-nginx"
        }
      }
    
      data = {
        client-max-body-size = "32M"
        proxy-buffer-size    = "32M"
      }
    }
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search