V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
nikoo
V2EX  ›  问与答

Nginx 是不是有个直接配置显示文本的指令?

  •  
  •   nikoo · 2016-12-29 09:40:07 +08:00 · 1138 次点击
    这是一个创建于 2696 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我记得是:
    location /test {
    show-text "Just a test!";
    }

    然后访问 /test 显示文本 Just a test!
    有没有这个 show-text 指令?这个指令名字是啥来着?
    谢谢!
    3 条回复    2016-12-29 10:45:55 +08:00
    Niphor
        1
    Niphor  
       2016-12-29 09:57:55 +08:00
    echo ?
    yangg
        2
    yangg  
       2016-12-29 10:09:16 +08:00
    echo 好像是 openresty 的,可以直接 return "Just a test!"
    nlzy
        3
    nlzy  
       2016-12-29 10:45:55 +08:00 via iPhone   ❤️ 1
    location = /test {
    default_type text/plain;
    return 200 "Just a test!";
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2793 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:01 · PVG 23:01 · LAX 08:01 · JFK 11:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.