I am trying to inject the time of an nginx server into an HTTP header.
I am able to add to an HTTP header, like so:
proxy_set_header HELLO-WORLD 'something';
But now, I want to be able to inject the time into an HTTP header, something that looks like this:
proxy_set_header THE-TIME $time_var;
Or something like that.
Would that be possible?
You can use variables from SSI modulе: $date_gmt and $date_local
proxy_set_header THE-TIME $date_gmt;
http://nginx.org/en/docs/http/ngx_http_ssi_module.html#variables
$time_iso8601
is both machine- & human-friendly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With