<p>We decided to move our apps from Service:LoadBalancer to Ingress, and I've chosen <strong>Nginx Ingress Controller</strong>, as I'm familiar with it, and because it's one of the most popular controllers in Kubernetes world</p>

<p>Previously we had Nginx => Uwsgi combination that stands behind ELB. We compile nginx from source, as we need some 3rd party modules and Lua support.</p>

<pre><code>ELB =&gt; Nginx Server =&gt; UWSGI
ELB =&gt; Nginx Ingress (Load Balancer) =&gt; Nginx (Server) =&gt; UWSGI
</code></pre>

<p>My question is: is it okay to have 2 nginx in a proxy chain? </p>

<p>I understand that one plays the role of LoadBalancer, and another is a server itself. But for me it comes with a pain, like if I change some options in Server nginx.conf, like increase the size of client body to 8MB, I should do the same on Nginx-Ingress. Also I'm wondering how to set timeouts: as there is a timeout between ingress=>server and server=>uwsgi, and in general how to tune the performance while having 3 proxies before request hits the app?</p>

<p>Is it a good practice to remove Nginx Server, so Ingress Controller acts like a server and loadbalancer at the same time? What about 3rd party modules that we use?</p>

<ol>
<li>There's nothing wrong in principle with having 2 or more nginx in a proxy chain, other than, as alluded to in the question and in the below, the extra complexity.</li>
<li>It is a pain to maintain consistent configuration across multiple proxies, and in particular to have upstream configuration bleed into ingress. It can get very complicated when the same ingress serves multiple upstreams each with different traffic requirements. But this is often nevertheless unavoidable. </li>
<li>Each hop will have its own distinct timeout and retry configuration, and managing them can be complicated, especially the downstream timeout when upstream has retries. One can wind up with very strange failure patterns. </li>
<li>It is not a good idea to bundle an application with an ingress controller. Ingress is about offering a stable entry point into the cluster for out-of-cluster traffic, and distributing that traffic to multiple upstream applications in the cluster. If there is only one upstream application, one really does not need ingress, so if possible much better to just expose it as a Service, either using NodePort or LoadBalancer, depending on circumstance.   </li>
</ol>
