【发布时间】:2019-08-01 08:13:40
【问题描述】:
location / {
fastcgi_intercept_errors on;
proxy_pass https://drive.google.com/uc?$query_string;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host drive.google.com;
proxy_set_header Referer https://drive.google.com;
error_page 301 302 307 = @handle_redirects;
}
location @handle_redirects {
set $redirect_location '$upstream_http_location';
proxy_pass $redirect_location;
proxy_cache ngx-cache;
proxy_cache_key $query_string;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
curl -I -A "ua" https://server/dl?id=trhtyjkfktkghjsutrtujyuk 直接返回 302 而不是转到 handle_redirects 部分,此配置适用于我的另一个带有服务器 Tengine 的 vps,但它不适用于我的另一个带有原始版本 nginx 的 vps,不知道哪里出了问题。任何帮助将不胜感激。谢谢!!
【问题讨论】: