Skip to content

Instantly share code, notes, and snippets.

@pahud
Last active February 4, 2016 17:46
Show Gist options
  • Save pahud/8c5b945cf86f3d4fcb60 to your computer and use it in GitHub Desktop.
Save pahud/8c5b945cf86f3d4fcb60 to your computer and use it in GitHub Desktop.
openresty-common-extra-locations.conf for pahud/openresty Docker image
location = /time { content_by_lua_block { ngx.say( ngx.time() ) } }
location = /today { content_by_lua_block { ngx.say( ngx.today() ) } }
location = /http_time { content_by_lua_block { ngx.say( ngx.http_time(ngx.now()) ) } }
location = /cookie_time { content_by_lua_block { ngx.say( ngx.cookie_time(ngx.now()) ) } }
location = /utctime { content_by_lua_block { ngx.say( ngx.utctime() ) } }
location = /localtime { content_by_lua_block { ngx.say( ngx.localtime() ) } }
location = /now { content_by_lua_block { ngx.say( ngx.now() ) } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment