【发布时间】:2017-02-04 04:17:54
【问题描述】:
我在 Nginx 中愚蠢地使用 301 而不是 302 进行特定重定向
location /somewhere/ {
return 301 /somewhere/neat/;
}
但现在我也需要更改重定向的位置:
location /somewhere/ {
# 302 now, lets not make the same mistake again!
return 302 /somewhere/else/entirely/;
}
如果我以隐身模式查看 URL 或破坏我的浏览器重定向缓存,我当然可以看到这种变化,但许多用户如果不自己做同样的事情就看不到它。即使我们可以可靠地指示我们的客户破坏他们的缓存,我们也只能到达其中的一小部分,而其余的都将保留旧内容。
【问题讨论】:
-
对 w/ngnix 和 ssl 没有超级经验(所以不确定这个答案是否完全适用,但是)有同样的问题,我只需要清除浏览器上的缓存来解决缓存问题。 (就我而言,我怀疑是由于当天早些时候测试了重定向(使用旧站点)。
标签: redirect caching nginx browser-cache http-status-code-301