1 Star 0 Fork 0

kuoyihp/nginx-lua-module-zh-wiki

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ngxsend_headers.md 1.13 KB
一键复制 编辑 原始数据 按行查看 历史

ngx.send_headers

语法: ok, err = ngx.send_headers()

环境: rewrite_by_lua, access_by_lua*, content_by_lua**

指名把应答头发送出去。

自从 v0.8.3 版本开始,成功情况该函数返回 1 ,否则返回 nil 和错误字符描述信息。

注意,在内容通过 ngx.sayngx.print 输出或当 content_by_lua 存在时,ngx_lua 将自动发送头部内容,所以通常情况不需要手动发送应答头。

返回目录

English source:

ngx.send_headers

syntax: ok, err = ngx.send_headers()

context: rewrite_by_lua, access_by_lua*, content_by_lua**

Explicitly send out the response headers.

Since v0.8.3 this function returns 1 on success, or returns nil and a string describing the error otherwise.

Note that there is normally no need to manually send out response headers as ngx_lua will automatically send headers out before content is output with ngx.say or ngx.print or when content_by_lua exits normally.

Back to TOC

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qizhendong_admin/nginx-lua-module-zh-wiki.git
git@gitee.com:qizhendong_admin/nginx-lua-module-zh-wiki.git
qizhendong_admin
nginx-lua-module-zh-wiki
nginx-lua-module-zh-wiki
master

搜索帮助