Replies: 2 comments 4 replies
-
Hi @pzaj2 Just to double check, you'd like to do something like below? apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: headers
spec:
parentRefs:
- name: gateway
sectionName: http
hostnames:
- "echo.example.com"
rules:
- matches:
- path:
type: PathPrefix
value: /headers
filters:
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: my-request-time
value: $time_local # https://nginx.org/en/docs/http/ngx_http_core_module.html#var_time_local
backendRefs:
- name: headers
port: 80 |
Beta Was this translation helpful? Give feedback.
4 replies
-
I just realized I didn't attach the issue I created for this. Here's the story for the first pass at this work with acceptance criteria. Thanks again! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd love to be able to use variables available in NGINX to modify inbound requests. My use case is fairly straightforward: I'd like to provide a unified header with "request timestamp" to all my applications. While I can't rely on information sent by the client (for hopefully obvious reasons), I surely can rely on information provided by my gateway.
Based on my understanding of the source code, the method that allows variable expansion already exists here.
Theoretically - again, based on my understanding - all it'd take to enable such functionality is using the aforementioned method here.
To the point, my questions are as follows:
Beta Was this translation helpful? Give feedback.
All reactions