squid 301错误其中之一的解决办法

这两天将老站点改域名成为一个新站点, 并且同时还是还要支持老域名. 按照常规,只需要在nginx上增加新的域名, 并且在squid上改成新的域名. 恰恰就是这个问题. 刚开始点一两个页面还是没问题. 但是点击后面的文章, 全是一片空白. 然后我跳过squid 都能直接访问到.

然后同chrome开发工具测试, 打开那些页面都是301问题. 然后仔细一看配置. squid上是新域名, nginx是新老域名直接访问新站点. 这时候, 是否认为当我访问一个老域名缓存的cache页面, 她将自动跳转到新域名. 但是这个时候 新域名的这个页面确实不存在的.所以导致返回的code是301.

 

而且奇怪的是location 怎么是http://www.msg.com 难道是原先访问的跳转地址?

既然有了测试结果, 那么就直接修改nginx. 将老域名单独设置 并且自动全部跳转的新域名上, 并且同时情况squid缓存. 重新生成squid缓存. 启动squid..

目前测试下来 已经不存在301问题了.

Leave a Comment

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: