static 模块对url不以斜杠结尾访问目录的做法
- static 模块实现了 root/alias 功能时,发现访问目标是目录,但URL 末尾未加 / 时,会返回301 重定向;
重定向跳转的域名
-
server_name_in_redirect
:
- syntax: server_name_in_redirect on | off;
- default: server_name_in_redirect off;
- context: http, server, location
-
port_in_redirect
:
- syntax: port_in_redirect on | off;
- default: port_in_redirect off;
- context: http, server, location
-
absolute_redirect
:
- syntax: absolute_redirect on | off;
- default: absolute_redirect off;
- context: http, server, location
示例配置
server {
server_name return.go.com dir.go.com