一 proxy_redirect的作用
proxy_redirect 该指令用来修改被代理服务器返回的响应头中的Location头域和“refresh”头域。
二 语法结构
proxy_redirect 旧地址 新地址;
proxy_redirect default; #默认配置
proxy_redirect off; #关闭重定向
三 案例
如果需要修改从被代理服务器传来的应答头中的"Location"和"Refresh"字段,可以用这个指令设置。
1.假设被代理服务器返回Location字段为: http://localhost:8000/two/some/uri/
这个指令:proxy_redirect http://localhost:8000/two/ http://frontend/one/;
将Location字段重写为http://frontend/one/some/uri/。
2.在代替的字段中可以不写服务器名:
| 1 |

最低0.47元/天 解锁文章

1246

被折叠的 条评论
为什么被折叠?



