2

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.

Sabir Piludiya
  • 179
  • 1
  • 2
  • 14
  • First I'd check if this is not VPN related for sure (found a machine within the same network and see if the same error occurs). If not possible, it's about guess game. You can see some options in [another SO answer](https://stackoverflow.com/questions/58215104/whats-the-neterr-http2-protocol-error-about) – moonkotte Sep 20 '21 at 11:22
  • @WytrzymałyWiktor I solved this and the answer is marked. – Sabir Piludiya Sep 23 '21 at 12:41

2 Answers2

2

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.

Sabir Piludiya
  • 179
  • 1
  • 2
  • 14
0

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"
  }
}

japrescott
  • 4,736
  • 3
  • 25
  • 37