<p>In my Kubernetes Cluster i have some challenges with the Ingress. As example i installed NodeRed und the Nginx-ingress via Helm. NodeRed is available via</p>

<ul>
<li>FQDN: <a href="http://my.server.name:31827" rel="nofollow noreferrer">http://my.server.name:31827</a></li>
<li>IP: <a href="http://10.x.x.x:31827" rel="nofollow noreferrer">http://10.x.x.x:31827</a></li>
</ul>

<p>Now i created an Ingress: </p>

<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: nr-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - secretName: tls-secret1
    hosts:
    - my.server.name
  rules:
  - host: my.server.name
    http:
      paths:
      - path: /nr
        backend:
          serviceName: my-nodered-node-red
          servicePort: 1880
</code></pre>

<p>When i do a Get <a href="http://my.server.name/nr" rel="nofollow noreferrer">http://my.server.name/nr</a> i see only parts working, see the screenshot:</p>

<p><a href="https://i.stack.imgur.com/3gVFP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3gVFP.png" alt="enter image description here"></a></p>

<p>It looks to me, that i missed the reverse proxy settings. Normally i would place those things in a reverse proxy setting in the nginx like this. But this is not possible because i am using the Nginx-ingress. </p>

<pre><code>location / {
     proxy_pass http://localhost:1880/;
    }
</code></pre>

<p>But i do not know how to do that in Kubernetes ? What do i miss ? kubernetes version is 1.14.1.</p>

Mchoeti
<p>I haven't used it so I'm not sure if it helps, but you might want to try adding an annotation for <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#proxy-redirect" rel="nofollow noreferrer">Proxy redirect</a>.</p>
<blockquote>
<p>With the annotations  <code>nginx.ingress.kubernetes.io/proxy-redirect-from</code>  and  <code>nginx.ingress.kubernetes.io/proxy-redirect-to</code>  it is possible to set the text that should be changed in the  <code>Location</code>  and  <code>Refresh</code>  header fields of a  <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect" rel="nofollow noreferrer">proxied server response</a></p>
<p>Setting &quot;off&quot; or &quot;default&quot; in the annotation  <code>nginx.ingress.kubernetes.io/proxy-redirect-from</code>  disables  <code>nginx.ingress.kubernetes.io/proxy-redirect-to</code>, otherwise, both annotations must be used in unison. Note that each annotation must be a string without spaces.</p>
<p>By default the value of each annotation is &quot;off&quot;.</p>
</blockquote>
<p>Also you can use <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">ConfigMap</a> for customizing your Nginx configuration.</p>
<pre><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-configuration
  namespace: ingress-nginx
  labels:
    app: ingress-nginx
data:

  http-snippet: |
      location = / {       
        proxy_pass http://localhost:1880/;
      }
</code></pre>
<p>Or <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#server-snippet" rel="nofollow noreferrer"><code>server-snippets</code></a> annotation for your <code>Ingress</code>:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: nr-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/server-snippet: |
      location = / {       
        proxy_pass http://localhost:1880/;
      }
spec:
  tls:
  - secretName: tls-secret1
    hosts:
    - my.server.name
  rules:
  - host: my.server.name
    http:
      paths:
      - path: /nr
        backend:
          serviceName: my-nodered-node-red
          servicePort: 1880
</code></pre>
<p>I hope this helps.</p>
