UnblockNeteaseMusic 配合 nginx 转发

发布于 2019-06-24  84 次阅读


GitHub链接 https://github.com/nondanee/UnblockNeteaseMusic

1、安装Nodejs

#Debian/Ubuntu系统
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt install -y nodejs git 

#CentOS系统
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
yum install nodejs git -y

2、安装 UnblockNeteaseMusic

git clone https://github.com/nondanee/UnblockNeteaseMusic.git
  1. 安装为服务
cat > /etc/systemd/system/UBN.service <<EOF
[Unit]
Description=UnblockNeteaseMusic
After=network.target
Wants=network.target

[Service]
Type=simple
PIDFile=/var/run/UnblockNeteaseMusic.pid
WorkingDirectory=/root/UnblockNeteaseMusic
ExecStart=/usr/bin/node app.js -s -e https://<your.domain>
RestartPreventExitStatus=23
Restart=always

[Install]
WantedBy=multi-user.target
EOF

4.开机自启

systemctl start UBN
systemctl enable UBN
  1. nginx
server {
    listen 443;
    server_name your_domain;

    ssl on;
    ssl_certificate 1_your_domain_bundle.crt; # 改为自己申请得到的 crt 文件的名称
    ssl_certificate_key 2_your_domain.key; # 改为自己申请得到的 key 文件的名称
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://localhost:8080; # 代理到 Unblock 服务地址
    }
}

我起了,一枪秒了,有什么好说哒。