Skip to content

Instantly share code, notes, and snippets.

@es
Last active February 2, 2017 22:04
Show Gist options
  • Save es/ef4da0558c23f8a9e83d1f54ae12bca9 to your computer and use it in GitHub Desktop.
Save es/ef4da0558c23f8a9e83d1f54ae12bca9 to your computer and use it in GitHub Desktop.
Example Nginx (built with OpenResty’s Lua module) config adding a header with the time since epoch to responses
events {
worker_connections 42;
}
http {
server {
listen 8080;
header_filter_by_lua_block {
ngx.header['X-Epoch'] = ngx.time()
}
location / {
return 200 'Hello, World!';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment