全球主机交流论坛

标题: 关于nginx反代缓存问题…… [打印本页]

作者: pojtt    时间: 2013-2-2 20:33
标题: 关于nginx反代缓存问题……
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name xxx.xx;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.         location / {
  7.         subs_filter 'http://www.sunk.eu.org/' '/';
  8.         proxy_set_header   X-Real-IP  $remote_addr;
  9.         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  10.         proxy_set_header   Referer http://www.sunk.eu.org/;       
  11.         proxy_set_header   Host www.sunk.eu.org;                 
  12.         proxy_pass http://www.sunk.eu.org/;                       
  13.         proxy_set_header Accept-Encoding "";               
  14.         expires 5d;
  15.                
  16.         proxy_cache cache_one;
  17.         proxy_cache_valid  any 3d;
  18.         proxy_cache_key $host$uri$is_args$args;
  19. access_log off;
  20.         }
  21. }
复制代码
这样缓存正常……

  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name xxx.xx;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.         location / {
  7.         subs_filter 'http://www.vpsmm.com/' '/';
  8.         proxy_set_header   X-Real-IP  $remote_addr;
  9.         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  10.         proxy_set_header   Referer http://www.vpsmm.com/;       
  11.         proxy_set_header   Host www.vpsmm.com;                 
  12.         proxy_pass http://www.vpsmm.com/;                       
  13.         proxy_set_header Accept-Encoding "";               
  14.         expires 5d;
  15.                
  16.         proxy_cache cache_one;
  17.         proxy_cache_valid  any 3d;
  18.         proxy_cache_key $host$uri$is_args$args;
  19. access_log off;
  20.         }
  21. }
复制代码
小夜的博客就无法缓存……
然后又试了些其他网站
貌似header里有“Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0”都缓存不了……
球大神解决
作者: 余留香    时间: 2013-2-2 20:38
等待高人.....原来还有这手
作者: pojtt    时间: 2013-2-2 20:39

Cache-Control不是对浏览器才有效么
作者: pojtt    时间: 2013-2-2 20:59
求解
作者: wdlth    时间: 2013-2-2 21:32
官方都说得很清楚了还来问……
http://wiki.nginx.org/HttpProxyModule#proxy_ignore_headers
作者: pojtt    时间: 2013-2-2 21:45
wdlth 发表于 2013-2-2 21:32
官方都说得很清楚了还来问……
http://wiki.nginx.org/HttpProxyModule#proxy_ignore_headers ...

3Q……
已经解决问题
作者: XWS    时间: 2013-2-3 05:22
wdlth 发表于  昨天 21:32
官方都说得很清楚了还来问……
http://wiki.nginx.org/HttpProxyModule#proxy_ignore_headers...

大神,求搞基。




欢迎光临 全球主机交流论坛 (https://sunk.eu.org/) Powered by Discuz! X3.4