王逗逼

宝塔面板CDN节点(解决可登陆退出)cdn的配置
曾经发过宝塔安装cdn的具体方法配置修改方法如图代码如下参考#PROXY-START/ location  ~* ...
扫描右侧二维码阅读全文
14
2020/06

宝塔面板CDN节点(解决可登陆退出)cdn的配置

曾经发过宝塔安装cdn的具体方法

配置修改方法如图
宝塔cdn配置位置图

代码如下参考

#PROXY-START/
location  ~* \.(php|jsp|cgi|asp|aspx|xhr|json)$
{
    proxy_pass https://www.你的域名.com;
    proxy_set_header Host www.你的域名.com;
    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;
}
location /
{
    proxy_pass https://www.你的域名.com;
    proxy_set_header Host www.你的域名.com;
    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;
    
    add_header X-Cache $upstream_cache_status;
    
    #Set Nginx Cache
    
    
    proxy_ignore_headers Set-Cookie Cache-Control expires;
    proxy_cache cache_one;
    proxy_cache_key $host$uri$is_args$args;
    proxy_cache_valid 200 304 301 302 60m;
    expires 12h;
}

#禁止缓存后台
location /admin
{
    proxy_pass https://www.你的域名.com;
    proxy_set_header Host www.你的域名.com;
    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;
    
    add_header X-Cache $upstream_cache_status;
        #Set Nginx Cache
        proxy_ignore_headers Set-Cookie Cache-Control expires;
        add_header Cache-Control no-cache;
    expires 12h;
}

#PROXY-END/
Last modification:June 14th, 2020 at 01:27 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment