Reputation: 4755
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?
Upvotes: 13
Views: 29465
Reputation: 15110
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
Upvotes: 16