location ~ "^/proxy/bilibili/(.*)$" { valid_referers none blocked localhost hooyim.com *.hooyim.com;
if ($invalid_referer) {
return 403;
}
resolver 114.114.114.114 114.114.115.115 8.8.8.8 valid=300s;
resolver_timeout 10s;
proxy_redirect off;
proxy_pass http://$1$is_args$args;
# proxy_set_header Referer "https://www.hooyim.com";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header User-Agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3223.8 Safari/537.36";
# 忽略相关 header 信息,使缓存最大化生效
proxy_ignore_headers Set-Cookie Cache-Control;
proxy_hide_header Cache-Control;
proxy_hide_header Set-Cookie;
expires 7d;
}
上面是我目前的配置,/proxy/bilibili/后面跟的是 bilibili 的视频封面地址,想把 /proxy/bilibili/的地址代理到后面的跟着的地址,但是会出现 502 的问题,有大佬帮忙看看吗