<p>I have nginx with following configuration: </p>

<pre><code>  proxy_redirect off;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  client_max_body_size 1g;
  client_body_buffer_size 128k;
  proxy_connect_timeout 120;
  proxy_send_timeout 240;
  proxy_read_timeout 240;
  proxy_buffers 32 4k;

  proxy_hide_header Strict-Transport-Security;
  proxy_hide_header Content-Type;
  add_header Content-Type application/json;
</code></pre>

<p>I would like to translate my nginx config to kubernetes ingress-nginx (Ingress resource). Is there a way to implement this config using kubernetes Ingress resources? Reading ingress-nginx docs I haven't found how to map proxy_pass or multiple rewrites to Ingress resource. I would appreciate ref to some detailed doc or sample with similar config.</p>

<p>Yes can do it using Snippets and Custom Templates as explained <a href="https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/configmap-and-annotations.md" rel="nofollow noreferrer">here</a> in NGINX Ingress Controller documentation by nginxinc.</p>

<p>Example of using Snippets via ConfigMap:</p>

<pre><code>---
# Source: nginx-ingress/templates/controller-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-config
  labels:
    app.kubernetes.io/name: nginx-ingress
    helm.sh/chart: nginx-ingress-0.3.4
    app.kubernetes.io/managed-by: Tiller
    app.kubernetes.io/instance: RELEASE-NAME
data:
   server-snippets: |
    location /helloworld {
      proxy_redirect off;
      proxy_http_version 1.1;
    }
</code></pre>
