在海外,网易云音乐由于版权原因,封锁了海外IP的播放(访问可以)。这里记录一个Nginx反向代理配置,可自建搭配。系统Linux即可。
新建一个nginx配置,如下:
# Cahce
proxy_cache_path  /var/cache/nginx  levels=1:2    keys_zone=STATIC:10m inactive=24h  max_size=1g;
server {
    listen       80;
    listen       [::]:80;
    server_name  music.163.com;
    location /weapi/feedback/weblog {
        add_header Set-Cookie "os=uwp; path=/";
        error_page 405 = $uri;
        alias /var/www/163/163-uwp.json;
    }
    
    location / {
        proxy_redirect off;
        proxy_pass http://music.163.com/;
        proxy_set_header X-Real-IP 114.114.115.116;
        proxy_cache            STATIC;
        proxy_cache_valid      200  1d;
        proxy_cache_use_stale  error timeout invalid_header updating
                               http_500 http_502 http_503 http_504;
    }
}
在/var/www/163文件夹下创建一个叫163-uwp.json的文件,填入以下内容:
{"code":200,"uwp":1}
启动nginx后修改本地hosts即可访问。
至于如何播放,请看此篇:https://www.d0z.net/archives/7336