Hydrate headers from remote endpoint
Key | Type | Required | Default | Description |
---|---|---|---|---|
appendOn.statusCodes | []int | Remote status codes at which headers will be appended | ||
fetchOn.cookies | []string | Only fetch remote when any of cookies from this list present in original request | ||
fetchOn.headers | []string | Only fetch remote when any of headers from this list present in original request | ||
fetchOn.or | bool | false | When both fetchOn.cookies and fetchOn.headers conditions are present, evaluate them as OR (by default as AND ) | |
forwardHeaders | []string | List of headers from original request to be passed to remote | ||
headers | map[string]string | :white_check_mark: | Map of headers in which to set remote response (key is header name, value is Go template) | |
nextOn.statusCodes | []int | Remote status codes at which next middleware will be called | ||
remote.method | string | GET | Request method | |
remote.url | string | :white_check_mark: | Url to be fetched | |
statusCodeError | int | 503 | Status code sent to client on nextOn conditions failure |
X-Example: '{{ .RemoteBody }}'
X-User-Id: |{{ $user := unmarshalJson .RemoteBody }}{{ $user.id }}
X-Example: '{{ .RemoteResponse.Header.Get "X-Remote-Header" }}'
X-Real-Ip: '{{ .Request.Header.Get "Cf-Connecting-Ip" }}'