想法同一楼,只要服务器设置好 SSL 证书,其他反代配置跟普通的一样。
举例,最近弄的反代逸站 API
server {
listen 80;
listen 443 ssl;
server_name
app.bilibili.com api.bilibili.com;
ssl_certificate ssl/bili.crt;
ssl_certificate_key ssl/bili.key;
ssl_session_timeout 5m;
access_log biliapi-access.log;
include fakebili.conf;
location / {
proxy_pass http://121.32.238.201;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location /x/v2/splash {
add_header Content-Type "application/json;charset=utf-8";
return 200 $fakebili_splash;
}
}
}
嗯,我这么做就是想篡改逸站手机应用。