0

I have a kinda weird set up where I have a general url(www.example.com) that terminates on an F5 that points to a nginx VS on an EKS cluster that has a localized domain(www.ue1.example.com).

So the flow is user -->> www.example.com --> F5 --> F5 xforwards host header of www.ue1.example.com --> nginx vs --> web service that is licenses for www.example.com.

nginx needs a host of www.ue1.example.com but then convert it to www.example.com before sending it to the web service.

So is there a way to route to a virtulserverroute AND proxy the host header as well. Here are the relevant configs. Not sure where to put the proxy information.

apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  name: example
spec:
  host: example.ue1.eexchange.com
  routes:
    - path: /
      route: example/example

apiVersion: k8s.nginx.org/v1
kind: VirtualServerRoute
metadata:
  name: example
spec:
  upstreams:
    - name: example-service
      service: example
      port: 80
  subroutes:
    - path: /
      action:
        pass: example-service

1 Answer 1

0

The solution was to apply this to the vsr.

  subroutes:
    - path: /
      action:
        proxy:
          upstream: example-service
          requestHeaders:
            set:
            - name: Host
              value: <target fqdn>
            - name: Origin
              value: http://<target fqdn>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.