github.com/projectcontour/contour@v1.28.2/site/content/docs/v1.14.2/config/external-service-routing.md (about) 1 # External Service Routing 2 3 HTTPProxy supports routing traffic to `ExternalName` service types. 4 Contour looks at the `spec.externalName` field of the service and configures the route to use that DNS name instead of utilizing EDS. 5 6 There's nothing specific in the HTTPProxy object that needs to be configured other than referencing a service of type `ExternalName`. 7 HTTPProxy supports the `requestHeadersPolicy` field to rewrite the `Host` header after first handling a request and before proxying to an upstream service. 8 This field can be used to ensure that the forwarded HTTP request contains the hostname that the external resource is expecting. 9 10 _**Note:** The ports are required to be specified._ 11 12 ```yaml 13 # httpproxy-externalname.yaml 14 apiVersion: v1 15 kind: Service 16 metadata: 17 labels: 18 run: externaldns 19 name: externaldns 20 namespace: default 21 spec: 22 externalName: foo-basic.bar.com 23 ports: 24 - name: http 25 port: 80 26 protocol: TCP 27 targetPort: 80 28 type: ExternalName 29 ``` 30 31 To proxy to another resource outside the cluster (e.g. A hosted object store bucket for example), configure that external resource in a service type `externalName`. 32 Then define a `requestHeadersPolicy` which replaces the `Host` header with the value of the external name service defined previously. 33 Finally, if the upstream service is served over TLS, set the `protocol` field on the service to `tls` or annotate the external name service with: `projectcontour.io/upstream-protocol.tls: 443,https`, assuming your service had a port 443 and name `https`.