撰于 阅读 26

公益服反代增强

location / {
proxy_ssl_name $server;
proxy_ssl_server_name on;
proxy_pass $forward_scheme://$server:$port;
}

这个问题在于 misakaf 的反代不是登录网址,它还有一个媒体播放网址 stream1.misakaf.org
这样就必须先反代 stream1.misakaf.org,然后在配置加一项替换。

location / {
    proxy_ssl_name $server;
    proxy_ssl_server_name on;
    proxy_pass $forward_scheme://$server:$port;
    sub_filter 'stream1.misakaf.org' '.xyz';
    proxy_redirect https://stream1.misakaf.org/ https://s.788885.xyz/;
    sub_filter_once off;
    sub_filter_types text/html application/javascript text/css;
proxy_set_header Accept-Encoding "";
}

上面方法不对,后方媒体播放网址有多个,stream1-stream4,需要4个子域名反代。
反代登录网址代码

client_max_body_size 20M;
   add_header X-Frame-Options "SAMEORIGIN";
   add_header X-XSS-Protection "1; mode=block";
   add_header X-Content-Type-Options "nosniff";
location / {
       # 你需要反代的emby服务器域名
       proxy_pass https://emby.aca.best;
       # 你需要反代的emby推流地址
       proxy_redirect https://stream1.misakaf.org/ https://s1.a.xyz/;
       proxy_redirect https://stream2.misakaf.org/ https://s2.a.xyz/;
       proxy_redirect https://stream3.misakaf.org/ https://s3.a.xyz/;
       proxy_redirect https://stream4.misakaf.org/ https://s4.a.xyz/;
       # 你需要反代的emby服务器主页
       proxy_set_header Referer "https://emby.aca.best/web/index.html"; 
       proxy_set_header Upgrade $http_upgrade; 
       proxy_set_header Host $proxy_host; 
       proxy_ssl_server_name on; 
       proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
   }