#反向代理相关配置
#<HOST> 发送域名($host|www.bt.cn)
#<URL> 被代理的URL地址(https://www.bt.cn|https://www.bt.cn/)
#<SUB_OPEN> 是否需要替换字符串(off|on)
#<SRC> 被替换的字符串
#<DST> 替换为

proxy_pass <URL>;
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_set_header Accept-Encoding "";
add_header X-Cache $upstream_cache_status;

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";


location ~ /purge(/.*) { 
    proxy_cache_purge cache_one <HOST>$request_uri$is_args$args;
}

location / 
{	
    sub_filter "<SRC>" "<DST>";
    sub_filter_once <SUB_OPEN>;
    expires 12h;
}

location ~ .*\.(html|htm|png|gif|jpeg|jpg|bmp|js|css)?$
{   
    proxy_cache cache_one;
    proxy_cache_key $host$request_uri$is_args$args;
    proxy_cache_valid 200 304 301 302 1h;
    expires 24h;
}