Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

哔哩哔哩那块的视频封面的nginx反向代理该如何配置 #174

Closed
yah0130 opened this issue Nov 4, 2020 · 3 comments
Closed

Comments

@yah0130
Copy link

yah0130 commented Nov 4, 2020

哔哩哔哩那块的反代我配置好后,访问会出现403,这块反向代理配置应该如何配,大佬能帮忙解惑吗

@surmon-china
Copy link
Owner

nginx 里的配置需要自己配,但开发环境下的 基本反代 就可以确保「能工作」

@surmon-china surmon-china pinned this issue Dec 2, 2020
@yah0130
Copy link
Author

yah0130 commented Jan 28, 2021

nginx 里的配置需要自己配,但开发环境下的 基本反代 就可以确保「能工作」

我上生产环境后的nginx配置是这样的:
location ~ "^/proxy/bilibili/(.*)$" {
resolver 114.114.114.114 114.114.115.115 8.8.8.8 valid=300s;
resolver_timeout 10s;
proxy_pass https://$1$is_args$args;
}

但是发现会报403错误,试了好多方法都没解决,大佬能帮个忙吗

@yah0130
Copy link
Author

yah0130 commented Aug 19, 2021

请问反代网易云音乐的封面和音乐你是怎么配置的,能给一个指示吗
网易云
location ~ ^/proxy/music/(.*) {
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 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;
    }

bilibili
location ~ ^/proxy/bilibili/(.*) {
proxy_set_header Referer "https://www.bilibili.com";

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

Repository owner locked and limited conversation to collaborators Jan 29, 2022
@surmon-china surmon-china converted this issue into discussion #213 Jan 29, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants