Answer a question

I have a problem about the images returned via the apps running behind the nginx ingress controller. They always returns 200 instead of an expected 304 once visited.

Digging around, i've found out about the ability to add specific blocks within the servers; so added the following under metadata > annotations :

 ingress.kubernetes.io/server-snippets: |
   location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
     expires 30d;
     add_header Pragma public;
     add_header Cache-Control "public";
   }

The problems persists, so still getting a permanent 200; "ssh'ing" into the nginx pod and doing a cat on the nginx.conf created, I don't see this block appearing anywhere

So am kind of lost about how to improve it. I'm using kube-lego, but did not found out if it could have an impact here

Answers

Support for server-snippets annotation was added in nginx-0.9.0-beta.16. Upgrade your ingress controller image to quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.9.0-beta.16

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐