nginx直接返回系统时间和时间戳
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}‘;
}
还没有评论,来说两句吧...