源站和反代站是用同一个域名,只是做了解析线路自动指定源站或者反代站,在反代站hosts已经指定域名和源站ip。目前情况是通过反代站访问后会出现点击分类目录在点击首页后会出现页面不加载(只加载一个导航和logo)其他文章信息完全不加载,点击其他链接像页数或者文章,在点击首页也会出现一样的问题,多刷新几次的话又会重新加载。源站有开启宝塔网站加速缓存和memcached,Redis,WP Super Cache,静态资源使用了CDN。反代站配置文件更换成了下面这个:
- #PROXY-START/
- location /
- {
- #缓存媒体文件
- location ~* .jpg|.png|.gif|.jpeg|.ttf|.webp|.woff|.woff2|.ico$
- {
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_pass https://www.shopee6.com;
- proxy_cache cache_one;
- proxy_cache_valid 30d;
- proxy_ignore_headers Cache-Control;
- add_header X-Cache "$upstream_cache_status from $server_addr";
- }
-
- #缓存css、js、html
- location ~* .css|.js$
- {
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_pass https://www.shopee6.com;
- proxy_cache cache_one;
- proxy_cache_valid 3d;
- proxy_ignore_headers Cache-Control;
- add_header X-Cache "$upstream_cache_status from $server_addr";
- }
-
- proxy_pass https://www.shopee6.com;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header REMOTE-HOST $remote_addr;
-
- #持久化连接相关配置
- #proxy_connect_timeout 30s;
- #proxy_read_timeout 86400s;
- #proxy_send_timeout 30s;
- #proxy_http_version 1.1;
- #proxy_set_header Upgrade $http_upgrade;
- #proxy_set_header Connection "upgrade";
- #add_header X-Cache $upstream_cache_status;
-
- #expires 12h;
- }
- location /wp-admin {
- proxy_pass https://www.shopee6.com;
- proxy_cache_valid any 0s;
- }
- #PROXY-END/
复制代码
|
|