preserve-host

The service builds its links from the name it was called by. Without this filter it sees the internal name, and every link, redirect and cookie domain it writes leads there.

Parameters

This filter takes no argument.

Example

filters:
  - type: preserve-host

args is omitted because there is nothing to pass.

Notes

Both the Host header and the value Go puts on the wire are set, which is the point: set one and the two disagree, and that is the virtual-host bug that takes an afternoon.

The console adds it by itself to a new route whose upstream is an application reached directly: a service of the cluster, a container, a private address. Such an application is alone behind its address and reads the Host it receives - to check a WebSocket's origin (Grafana's live channel refuses a connection whose origin is not the Host it was given), to write its links. The filter shows in the list as the address is typed, and is removed like any other. A public name gets none, and an existing route is never changed.

Two pitfalls worth knowing: