I am trying to enable gzip compression in an app authenticated by Auth0. I am using the Kubernetes nginx controller with snippets enabled. The ingress has the following snippet:
nginx.ingress.kubernetes.io/server-snippet: |
gzip on;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_vary on;
gzip_proxied any;
gzip_types
text/plain
application/javascript
text/css
application/json
application/x-javascript
text/xml
application/xml
application/xml+rss
text/javascript
application/vnd.ms-fontobject
application/x-font-ttf
font/opentype;
However I can see there is no content-encoding: gzip
header in the response.
I can force this header by adding
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "Content-Encoding: gzip";
however I am not sure this will actually compress the resources and I would prefer to use the nginx configuration language to enable this.
I have confirmed that this snippet works when used with an ingress that does not go through Auth0.
Any help would be greatly appreciated.