nginx 直接返回json格式

nginx中可以使用如下配置返回json格式信息:

location /notify {

       add_header "Content-Type" "application/json";

        return 200 "{\"code\":0, \"msg\":\"接收成功\"}";

    }


请先 登录 后评论
  • 0 关注
  • 0 收藏,17 浏览
  • shitian 提出于 2026-01-13 15:43

相似问题