nginx直接返回系统时间和时间戳

我就是我 2022-09-15 12:54 292阅读 0赞

add_header Content-Type ‘text/html; charset=utf-8’;
location = /time {
default_type application/json;
add_header ‘Access-Control-Allow-Origin’ ‘*‘;
autoindex_localtime on;
add_header ‘Access-Control-Allow-Credentials’ ‘true’;
return 200 ‘{“currentTime”:$time_local, “timestamp”:$msec}‘;
}

发表评论

表情:
评论列表 (有 0 条评论,292人围观)

还没有评论,来说两句吧...

相关阅读