123直链代理规则

#PROXY-START/

location ^~ /web/
{
    proxy_pass http://vip.123pan.cn/**********/web/;
    proxy_set_header Host vip.123pan.cn;
    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_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_http_version 1.1;
    # proxy_hide_header Upgrade;
    proxy_intercept_errors on;  # 关键:允许Nginx处理后端错误状态码
    error_page 403 /404.html;

    add_header X-Cache $upstream_cache_status;
		#Set Nginx Cache

    proxy_set_header Accept-Encoding "";
		sub_filter "statics.123pan.com/static-by-custom" "cdn.rcku.cn";
		sub_filter "https://www.123pan.com/link" "";
    sub_filter_once off;

    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
        expires 1m;
    }
    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 600m;
}
#PROXY-END/