从揭秘上午埋下的“彩蛋”继续讨论:
如果你不需要把 https://voice.oaifree.com
反代成自己的域名,你不需要任何下列操作。从语音对话界面点 Leave
按钮的跳转地址已经修复。
如何反代 https://voice.oaifree.com
- Cloudflare Worker
export default {
async fetch(request, env) {
const url = new URL(request.url);
url.host = 'voice.oaifree.com';
return fetch(new Request(url, request));
}
}
- Nginx
location / {
proxy_pass https://voice.oaifree.com;
proxy_ssl_server_name on;
}
假设你反代的Voice域名是 https://voice.abc.com
,调整你反代 https://new.oaifree.com
的代码,通过 X-Voice-Base
头指定:
- Cloudflare Worker
export default {
async fetch(request, env) {
const url = new URL(request.url);
url.host = 'new.oaifree.com';
const modifiedRequest = new Request(url, request);
modifiedRequest.headers.set('X-Voice-Base', 'https://voice.abc.com');
return fetch(modifiedRequest);
}
}
- Nginx
location / {
proxy_pass https://new.oaifree.com;
proxy_set_header X-Voice-Base "https://voice.abc.com";
proxy_ssl_server_name on;
}
打完收工。