# 如何返回内容

# 返回文本

location /get_text {
    default_type text/html;
    return 200 'This is text!';  
}

# 返回JSON

location /get_json {
    default_type application/json;
    return 200 '{"status":"success","result":"nginx json"}';
}
上次更新: 2/13/2025, 3:29:47 AM