Kubernetes-ingress: Activate gzip support

Created on 1 Sep 2017  路  5Comments  路  Source: nginxinc/kubernetes-ingress

How can I activate gzip support. (currently I am editing it manually) but it is possible to use configmaps for this or is it possible to add gzip support via ingress files ?

cheers

Most helpful comment

@stickperson
it is possible to configure that using *-snippets annotations and configmap keys, which allow you to use native NGINX configuration. For example:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress
  annotations:
     kubernetes.io/ingress.class: "nginx"
     nginx.org/server-snippets: "gzip on;"
...

See http://nginx.org/en/docs/http/ngx_http_gzip_module.html to learn more about various gzip directives.

All 5 comments

@Uter1007 There are snippets annotations and a ConfigMap keys that you can use to insert the gzip-related directives into generated NGINX config. See https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/customization and an example https://github.com/nginxinc/kubernetes-ingress/blob/master/examples/customization/cafe-ingress-with-annotations.yaml

thx ;) I will try out

@Uter1007 have you figured this out? I don't see any mention of compression in the links above.

@stickperson
it is possible to configure that using *-snippets annotations and configmap keys, which allow you to use native NGINX configuration. For example:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress
  annotations:
     kubernetes.io/ingress.class: "nginx"
     nginx.org/server-snippets: "gzip on;"
...

See http://nginx.org/en/docs/http/ngx_http_gzip_module.html to learn more about various gzip directives.

@pleshakov ah, I completely missed the *-snippets annotations. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nabheet picture nabheet  路  7Comments

toddams picture toddams  路  6Comments

aprisniak picture aprisniak  路  4Comments

martinlevesque picture martinlevesque  路  3Comments

Nurlan199206 picture Nurlan199206  路  5Comments