关于Lua中的HTTP状态码以及Log等常量对照表
一. HTTP Status
1xx
- ngx.HTTP_CONTINUE (100) (first added in the v0.9.20 release)
- ngx.HTTP_SWITCHING_PROTOCOLS (101) (first added in the v0.9.20 release)
2xx
- ngx.HTTP_OK (200)
- ngx.HTTP_CREATED (201)
- ngx.HTTP_ACCEPTED (202) (first added in the v0.9.20 release)
- ngx.HTTP_NO_CONTENT (204) (first added in the v0.9.20 release)
- ngx.HTTP_PARTIAL_CONTENT (206) (first added in the v0.9.20 release)
3xx
- ngx.HTTP_SPECIAL_RESPONSE (300)
- ngx.HTTP_MOVED_PERMANENTLY (301)
- ngx.HTTP_MOVED_TEMPORARILY (302)
- ngx.HTTP_SEE_OTHER (303)
- ngx.HTTP_NOT_MODIFIED (304)
- ngx.HTTP_TEMPORARY_REDIRECT (307) (first added in the v0.9.20 release)
4xx
- ngx.HTTP_BAD_REQUEST (400)
- ngx.HTTP_UNAUTHORIZED (401)
- ngx.HTTP_PAYMENT_REQUIRED (402) (first added in the v0.9.20 release)
- ngx.HTTP_FORBIDDEN (403)
- ngx.HTTP_NOT_FOUND (404)
- ngx.HTTP_NOT_ALLOWED (405)
- ngx.HTTP_NOT_ACCEPTABLE (406) (first added in the v0.9.20 release)
- ngx.HTTP_REQUEST_TIMEOUT (408) (first added in the v0.9.20 release)
- ngx.HTTP_CONFLICT (409) (first added in the v0.9.20 release)
- ngx.HTTP_GONE (410)
- ngx.HTTP_UPGRADE_REQUIRED (426) (first added in the v0.9.20 release)
- ngx.HTTP_TOO_MANY_REQUESTS (429) (first added in the v0.9.20 release)
- ngx.HTTP_CLOSE (444) (first added in the v0.9.20 release)
- ngx.HTTP_ILLEGAL (451) (first added in the v0.9.20 release)
5xx
- ngx.HTTP_INTERNAL_SERVER_ERROR (500)
- ngx.HTTP_METHOD_NOT_IMPLEMENTED (501)
- ngx.HTTP_BAD_GATEWAY (502) (first added in the v0.9.20 release)
- ngx.HTTP_SERVICE_UNAVAILABLE (503)
- ngx.HTTP_GATEWAY_TIMEOUT (504) (first added in the v0.3.1rc38 release)
- ngx.HTTP_VERSION_NOT_SUPPORTED (505) (first added in the v0.9.20 release)
- ngx.HTTP_INSUFFICIENT_STORAGE (507) (first added in the v0.9.20 release)
二. Log Level
- ngx.STDERR -- 标准输出
- ngx.EMERG -- 紧急报错
- ngx.ALERT -- 报警
- ngx.CRIT -- 严重,系统故障,触发运维告警系统
- ngx.ERR -- 错误,业务不可恢复性错误
- ngx.WARN -- 告警,业务中可忽略错误
- ngx.NOTICE -- 提醒,业务比较重要信息
- ngx.INFO -- 信息,业务琐碎日志信息,包含不同情况判断等
- ngx.DEBUG -- 调试
版权声明: 本文为博主 网无忌 原创文章,欢迎转载,但请务必标注原文链接。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix