6.7. HTTP header configuration
When setting or deleting headers, you can use an individual route to modify request and response headers. You can also set certain headers by using route annotations. The various ways of configuring headers can present challenges when working together.
You can only set or delete headers within a Route CR. You cannot append headers. If an HTTP header is set with a value, that value must be complete and not require appending in the future. In situations where it makes sense to append a header, such as the X-Forwarded-For header, use the spec.httpHeaders.forwardedHeaderPolicy field, instead of spec.httpHeaders.actions.
Example Route spec
apiVersion: route.openshift.io/v1
kind: Route
# ...
spec:
httpHeaders:
actions:
response:
- name: X-Frame-Options
action:
type: Set
set:
value: SAMEORIGIN
Any actions defined in a route override values set using route annotations.
6.7.1. Special case headers リンクのコピーリンクがクリップボードにコピーされました!
The following headers are either prevented entirely from being set or deleted, or allowed under specific circumstances:
| Header name | Configurable using Route spec | Reason for disallowment | Configurable using another method |
|---|---|---|---|
|
| No |
The | No |
|
| Yes |
When the | No |
|
| No |
The |
Yes: the |
|
| No | The cookies that HAProxy sets are used for session tracking to map client connections to particular back-end servers. Allowing these headers to be set could interfere with HAProxy’s session affinity and restrict HAProxy’s ownership of a cookie. | Yes:
* the |