文章目录
rewrite 阶段的 rewrite 模块
rewrite 模块 return
指令
return
:- syntax:
return code [text]
,return code URL
,return URL
; - default: –
- context: server, location, if
- syntax:
return
返回状态码 :
-
Nginx 自定义:
- 444 : 关闭连接, 立即关闭
-
http 1.0 标准:
- 301: http 1.0 永久重定向;
- 302: 临时重定向, 禁止被缓存;
-
http 1.1 标准:
- 303: 临时重定向, 允许改变方法, 禁止被缓存;
- 307: 临时重定向, 不允许改变方法, 禁止被缓存;
- 308: 永久重定向, 不允许改变方法;
error_page
error_page
:- syntax: error_page code …[=[response]] uri;
- default: –
- context: http, server, location, if in location;
- 示例