<p>I have this service that limits IPs to 2 requests per day running in Kubernetes.
Since it is behind an ingress proxy the request IP is always the same, so it is limiting he total amount of requests to 2.</p>
<p>Its possible to turn on proxy protocol with a config like this:</p>
<pre><code>apiVersion: v1
metadata:
  name: nginx-ingress-controller
data:
  use-proxy-protocol: &quot;true&quot;
kind: ConfigMap
</code></pre>
<p>But this would turn it on for all services, and since they don't expect proxy-protocol they would break.</p>
<p>Is there a way to enable it for only one service?</p>

iaquobe
<p>It is possible to configure Ingress so that it includes the original IPs into the http header.</p>
<p>For this I had to change the service config.
Its called <code>ingress-nginx-ingress-controller</code>(or similar) and can be found with <code>kubectl get services -A</code></p>
<pre><code>spec: 
   externalTrafficPolicy: Local
</code></pre>
<p>And then configure the ConfigMap with the same name:</p>
<pre><code>data:
  compute-full-forwarded-for: &quot;true&quot;
  use-forwarded-headers: &quot;true&quot;
</code></pre>
<p>Restart the pods and then the http request will contain the fields  <code>X-Forwarded-For</code> and <code>X-Real-Ip</code>.</p>
<p>This method won't break deployments not expecting proxy-protocol.</p>
