配置nginx返回服务器系统时间戳

server {
           listen  80;
           server_name 45.137.11.154;
           add_header Content-Type 'text/html; charset=utf-8';
       location = /time {
        default_type application/json;
        add_header 'Access-Control-Allow-Origin' '*';
                add_header 'Access-Control-Allow-Credentials' 'true';
        proxy_pass http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp;               
# return 200 '{"currentTime":$time_local}';        
      }
}
 

猜你喜欢

转载自blog.csdn.net/weixin_39842528/article/details/115584411