Home > database >  disable cache in kubernetes Ingress
disable cache in kubernetes Ingress

Time:10-29

in kubernetes V 1.14.5 with ingress controller nginx-ingress-controller:0.21.0-rancher3 .I have below issue:

when userinfo api is called with internal service address (form inside cluster), it response fine (token is invalid). as below screenshot

  (( but when that API is called with its ingress name, it responses with list of permission while token is revoked. both requests use same tokens

enter image description here

I think its related to cache inside Ingress and Ingress Controller but I cant disable it vi annotation configuration

CodePudding user response:

If you are using the Nginx ingress controller you can use this snippet into the annotation

nginx.ingress.kubernetes.io/configuration-snippet : |
      if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
        expires 1M;
        add_header Cache-Control "public";
      }

inside the configuration, you can keep the simple Nginx config

CodePudding user response:

I've found the solution.

the root cause was related to wso2is nginx mosuled, and cache was configured there. I change cache time in nginx configuration inside wso2is

  • Related