设为首页 加入收藏

TOP

调试location指令时,直接让location输出文本
2019-09-14 00:51:31 】 浏览:45
Tags:调试 location 指令 直接 输出 文本

有时候我们调试location指令时希望location指令能够直接输出文本,这样能够方便我们进行调试。这时我们可以使用echo模块实现,但是大多数情况我们没有安装这个模块,那么我们还可以使用另一个方法来实现这个想法

  直接返回文本

location / {
  default-type text/plain;
  return 502 "this is a test message";        
}

  html标签格式

location / {
  default-type text/html;
  return 502 "this is a test message";        
}

  返回json文本

location / {
            default_type application/json;
            return 502 '{"name":"mayuan","age":18}';
        }

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇微信公众号商城怎么搭建和如何运营 下一篇[PHP] 内部接口简单加密验证方式

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目