I have an IdentityServer behind the Nginx ingress controller on Kubernetes. permissions of the users are presented as claims in JWT Token. when I am trying to log in with a user with a minimum or a small number of permissions it works appropriately. but when I change the user and try a user with lots of permissions I am encountered with 502 Bad Gateway error in response.
but I ran the code locally and the problem disappeared and all thing works properly.
there is a post on the SO and it says that we can resolve the problem by increasing the buffer size of the Nginx. I try this approach by adding these lines into my ingress definition :
nginx.ingress.kubernetes.io/proxy_buffer_size: 1024k
nginx.ingress.kubernetes.io/proxy_buffers: 4 1024k
nginx.ingress.kubernetes.io/proxy_busy_buffers_size: 1024k
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
but it does not help. am I wrong on some things? how can I debug or trace this situation and is there any known solution for this problem?