Cloudflare Workers 跳转当前请求到https 在fetch监听开头加入一行: if(event.request.headers.get('x-forwarded-proto')=='http'){event.respondWith(Response.redirect(event.request.url.replace(/^http/,'https'),301));return;}; 使用方式: addEventListener('fetch',event=>{ if(event.request.headers.get('x-forwarded-proto')=='http'){event.respondWith(Response.redirect(event.request.url.replace(/^http/,'https'),301));return;}; //剩余代码部分 });