Responding with Another Website: WordPress

Referencing this guy: https://developers.cloudflare.com/workers/examples/respond-with-another-site

I have the following setup.

For debugging purposes, send ALL traffic to the handler.

addEventListener('fetch', event => {    
    event.respondWith(sendToPantheon(event));
})

We then send that event to the following function and do some pretty standard stuff.

async function sendToPantheon(event) {
    var public_endpoint = 'https://www.example.com/blog';
    var pantheon_endpoint = 'https://example.pantheonsite.io';
    var isExpected = event.request.url.toString().includes(public_endpoint);

    // We don't want to break requests we were not expecting.
    if (!isExpected) {
        event.respondWith(fetch(event.request));
        return 
    }

   //
    var modified_request = event
        .request.url.toString()
        .replace(public_endpoint, pantheon_endpoint);

    var headers = new Headers();

    // Get the original payload, including headers, contents and so on.
    var new_response = await fetch(modified_request);

    var headers = new Headers();
    for (var kv of new_response.headers.entries()) {
        headers.append(kv[0], kv[1]);
    }

    return new Response(
        new_response.body,
        {
            status: new_response.status,
            statusText: new_response.statusText,
            headers: headers
        }
    )
}

My issue is, hitting /blog is working 100% fine as far as I can see. Additionally, hitting permalinks such as /blog/my-test-post is working 100% fine.

But when I try to hit the administration area /blog/wp-admin I am getting a 404.

Example CURL:

HTTP/2 404
date: Fri, 11 Jun 2021 15:23:10 GMT
content-type: #<Mime::NullType:0x00007f300506a630>; charset=utf-8
cf-ray: 65dbd6ccdd97180f-ATL
cache-control: no-cache
set-cookie: ahoy_visitor=f5c3a9a2-692a-4af4-904e-67289c628fb9; path=/; expires=Sun, 11 Jun 2023 15:23:10 GMT; secure, ahoy_visit=5c599dfc-ce26-42b1-b908-a182c8e9fa9d; path=/; expires=Fri, 11 Jun 2021 19:23:10 GMT; secure
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
via: 1.1 vegur
cf-cache-status: DYNAMIC
cf-request-id: 0a9d4494080000180ff502b000000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-request-id: 9b6f413a-dcab-4757-8271-a66e714a8966
x-runtime: 0.013544
x-xss-protection: 1; mode=block
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v2?s=tVMkwhIq2OdSBqN%2FSgskgCFkUVjSlExmwPlk2kJ7QQ7tt6Z8HEGyKJetyaFLBYQkCZARYTXYVTdtffJ1r5s6G9d7g1WITUr5tP173aizpTBj9Ls6IIwxEsQ%2F6ZL50d9Ro%2Fd5"}],"group":"cf-nel","max_age":604800}
nel: {"report_to":"cf-nel","max_age":604800}
server: cloudflare

I see that the content-type looks a little weird… but that doesn’t explain the 404.

The end goal of course is to be able to access the https://example.pantheonsite.io/wp-admin area via https://www.example.com/blog, passing cookies and so forth.

I’ve spent some time googling, working with the host support team and so on, but figured I’d ask the Cloudflare community.

Where can I go from here?