致力于为用户提供真实的
主机测评数据及优惠信息

nginx cdn Discuz刷新问题

网友 whl32 说:

Discuz站点,前端自建nginx  CDN节点,遇到问题是登录等*作后页面不会立即生效,比如登录提示成功后到首页显示未登录,按F5刷新后才显示登录的用户**。

nginx配置如下

  1. p**xy_cache_path /home/www**ot/bbs.Discuz.net l***ls=1:2 keys_zone=Discuz:50m inactive=30m max_size=50m;
  2. ****** {
  3.     listen 80;
  4.     ******_name bbs.Discuz.net;
  5.     acce**_log off;
  6.     #charset utf-8,gbk;
  7.         if ($re*uest_**i ~ ^/(index.html|login|register|pa**word|\/reset)) {
  8.         set $cookie_nocache 1;
  9.     }
  10.         location / {
  11.         p**xy_set_header Accept-Encoding &*uot;&*uot;;
  12.            p**xy_pa** http://bbs.Discuz.net;
  13.            p**xy_redirect off;
  14.            p**xy_set_header X-Real-IP $remote_addr;
  15.            p**xy_set_header X-Forwarded-For $p**xy_add_x_forwarded_for;
  16.            p**xy_cache Discuz;
  17.            p**xy_cache_key $host$**i$is_args$args;
  18.            p**xy_no_cache $cookie_nocache $arg_nocache $arg_comment;
  19.            p**xy_no_cache $http_pra**a $http_**tho**zation;
  20.            add_header Nginx-Cache &*uot;$upstream_cache_status&*uot;;
  21.            p**xy_cache_valid  200 304  30m;
  22.            p**xy_cache_valid  301 24h;
  23.            p**xy_cache_valid  500 502 503 504 0s;
  24.            p**xy_cache_valid any 1s;
  25.            p**xy_cache_min_uses 1;
  26.            expires 12h;
  27.     }
  28. }

网友 1121744186 说:

前端不是 ajax 分离的 动态页面 不能加 缓存

赞(0) 打赏
未经允许不得转载:爱主机 » nginx cdn Discuz刷新问题
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址