Using nginx ingress annotations to change host header for backend service

Hello,

I’m running Gitlab on Google Kubernetes Engine. Gitlab Pages serves static websites for URLs like my-project.example.io. I am trying to add nginx ingress rules to proxy something like my-project.com to Gitlab Pages as though the user requested my-project.example.com.

I have tried setting the nginx.ingress.kubernetes.io/upstream-vhost annotation to the desired pages URL, but it appears to still receive a request for my-project.com (which it does not understand). Does anyone have ideas on how to better accomplish this goal? My primary desire is to proxy to the internal service IP rather than the external IP for *.example.io.

P.S. Apologies for any bad formatting. I am completely blind, so sometimes that gets difficult. :slight_smile:

Oh. In addition, I have seen notes about Ruby using the X-Forwarded-Host header instead of Host. Does anyone know how I might overwrite this in the ingress?

Hey @mwcoop17. Did you ever find an answer to this? I have exactly the same problem (also for GitLab pages!). Thanks