<p>Just wondering if there is any way in ingress-nginx to enforce rate limiting only if the custom health check url is fine.
I have been going searching through, but failed to find a way to do so. Any help will be appreciated.</p>

Sam Alex
<p>Rate-limiting is available in NGINX Ingress by using correct <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#rate-limiting" rel="nofollow noreferrer">annotations</a> Available options are:</p>
<ol>
<li><p><code>nginx.ingress.kubernetes.io/limit-connections</code>: number of concurrent connections allowed from a single IP address. A 503 error is returned when exceeding this limit.</p>
</li>
<li><p><code>nginx.ingress.kubernetes.io/limit-rps</code>: number of requests accepted from a given IP each second. The burst limit is set to this limit multiplied by the burst multiplier, the default multiplier is 5. When clients exceed this limit, limit-req-status-code default: 503 is returned.</p>
</li>
<li><p><code>nginx.ingress.kubernetes.io/limit-rpm</code>: number of requests accepted from a given IP each minute. The burst limit is set to this limit multiplied by the burst multiplier, the default multiplier is 5. When clients exceed this limit, limit-req-status-code default: 503 is returned.</p>
</li>
<li><p><code>nginx.ingress.kubernetes.io/limit-burst-multiplier</code>: multiplier of the limit rate for burst size. The default burst multiplier is 5, this annotation override the default multiplier. When clients exceed this limit, limit-req-status-code default: 503 is returned.</p>
</li>
<li><p><code>nginx.ingress.kubernetes.io/limit-rate-after</code>: initial number of kilobytes after which the further transmission of a response to a given connection will be rate limited. This feature must be used with proxy-buffering enabled.</p>
</li>
<li><p><code>nginx.ingress.kubernetes.io/limit-rate</code>: number of kilobytes per second allowed to send to a given connection. The zero value disables rate limiting. This feature must be used with proxy-buffering enabled.</p>
</li>
<li><p><code>nginx.ingress.kubernetes.io/limit-whitelist</code>: client IP source ranges to be excluded from rate-limiting. The value is a comma separated list of CIDRs</p>
</li>
</ol>
<p>There are some limitations of rate-limiting with NGINX ingress:</p>
<p>It applies to the whole ingress and is not able to configure exceptions, eg. when you want to exclude a health check path /healthz from your service.</p>
<p>You can read more about  NGINX rate limiting in kubernetes in this <a href="https://medium.com/titansoft-engineering/rate-limiting-for-your-kubernetes-applications-with-nginx-ingress-2e32721f7f57" rel="nofollow noreferrer">guide</a>.</p>
