<p>I'm using <code>ingress-nginx</code> on kubernetes. I need to redirect incoming connections to <code>/</code> to a blog hosted on <a href="https://webflow.com/" rel="nofollow noreferrer">webflow</a> and perform path-based routing.</p>
<p>Webflow provides a domain like <code>website123.webflow.com</code>. I would like to serve the blog without performing a redirect. I would like to mask the webflow domain and use the default instead.</p>
<p>Here's what I came with so far:</p>
<pre><code>---
apiVersion: v1
kind: Service
metadata:
  name: homepage
spec:
  externalName: website123.webflow.io
  type: ExternalName
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    external-dns.alpha.kubernetes.io/hostname: my.custom.domain.com
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/load-balance: ewma
    nginx.ingress.kubernetes.io/proxy-body-size: 4G
    nginx.ingress.kubernetes.io/upstream-vhost: website123.webflow.io
    service.beta.kubernetes.io/do-loadbalancer-hostname: my.custom.domain.com
  labels:
    source: github
  name: http
  namespace: panattt1
spec:
  rules:
  - host: my.custom.domain.com
    http:
      paths:
      - path: /api
        backend:
          serviceName: http
          servicePort: 80
      - path: /images
        backend:
          serviceName: http
          servicePort: 80
      - path: /app
        backend:
          serviceName: http
          servicePort: 80
      - path: /game
        backend:
          serviceName: http
          servicePort: 80
      - path: /mapmaker
        backend:
          serviceName: http
          servicePort: 80
      - path: /dashboard
        backend:
          serviceName: http
          servicePort: 80
      - path: /
        backend:
          serviceName: homepage
          servicePort: 80
  tls:
  - hosts:
    - my.custom.domain.com

</code></pre>
<p>The above solution doesn't work as I'd like to. The URL in the browser changes from <code>my.custom.domain.com</code> to <code>website123.webflow.io</code>, which is not what I want.</p>
<p>I believe the host header reaches paths other than <code>/</code> which is not ideal. Not tested yet.</p>
<p>If remove <code>nginx.ingress.kubernetes.io/upstream-vhost</code> I get an error from webflow's CDN because the <code>$host</code> header uses a domain that is not available. Adding the custom domain produces the same error.</p>
<p>Any ideas if I can handle this situation gracefully using <code>ingress-nginx</code>?</p>

patm
<p>This works for me without annotations like upstream-vhost etc.</p>
<pre><code>kind: Service
metadata:
  name: blog-service
  namespace: panattt1
spec:
  externalName: website123.webflow.io
  ports:
  - port: 8001
    protocol: TCP
    targetPort: 443
  type: ExternalName

---

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;
    ingress.kubernetes.io/ssl-redirect: &quot;true&quot;
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: &quot;true&quot;
  name: blog-ingress
  namespace: panattt1
spec:
  rules:
  - host: my.custom.domain.com
    http:
      paths:
      - backend:
          serviceName: blog-service
          servicePort: 8001
        path: /
  tls:
  - hosts:
    - my.custom.domain.com
</code></pre>
