Gzip compression is not working in nginx ingress controller by F5

My issue: I want to enable gzip compression in nginx ingress controller by F5. gzip configmap key is not available directly. As mentioned in docs, to apply native nginx configurations we can use snippets.
I have configured gzip directives in http-snippets of my nginx controller config in values.yaml.

Solutions I’ve tried: This config gets applied successfully but compression is not working as Im not getting this header Content-Encoding: gzip in response. I also tried changing gzip_min_length but not luck.

My config:

controller:
      enableSnippets: true
      config:
        entries:
          http-snippets: |-
            gzip on;
            gzip_min_length 100;
            gzip_buffers    4 8k;
            gzip_types  text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;

The issue is fixed, I had to add this as well alongside.
gzip_proxied no-cache no-store private expired auth;

1 Like