<p>According to this article one need to set some nginx properties when running a .NET Core 2.x application using https and Azure AD Authentication behind Nginx in a Kubernetes cluster:</p>

<p><a href="https://stackoverflow.com/questions/48964429/net-core-behind-nginx-returns-502-bad-gateway-after-authentication-by-identitys">.Net Core behind NGINX returns 502 Bad Gateway after authentication by IdentityServer4</a></p>

<p>The answer outlines how to do this for a regular Nginx installation, but I would like to do this when installing Nginx in a Kubernetes cluster using Helm.</p>

<p>These are the Nginx properties one need to set:</p>

<pre><code>nginx.conf:
    http{
    ...
    proxy_buffer_size   128k;
    proxy_buffers   4 256k;
    proxy_busy_buffers_size   256k;
    large_client_header_buffers 4 16k;
    ...
    }


default.conf:
location /{
    ...
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
    ...
}
</code></pre>

<p>The command I use to install Nginx in the Kubernetes cluster is:</p>

<pre><code>helm install stable/nginx-ingress --namespace kube-system
</code></pre>

<p>How does one set the above properties when installing Nginx using Helm in a Kubernetes cluster?</p>

OlavT
<p>It is possible to customize nginx configuration using ConfigMap.<br>
<a href="https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/customization/custom-configuration" rel="nofollow noreferrer">This is an example</a><br>
after adding the ConfigMap if nginx doesn't get updated, update your nginx chart using Helm:<br>
<code>helm upgrade [RELEASE] [CHART]</code><br>
<code>heml upgrade my-release stable/nginx-ingress</code><br>
if you don't know the [RELEASE] use following command:<br>
<code>helm list</code></p>
