Reverse proxy - Random "406 Not Acceptable" errors

Hey,

I’m currently hosting part of my website on Webflow, using a reverse proxy (Cloudflare Worker) to route some of the traffic to it from one of my hostnames.

An issue that has come up a few times in the last week is all requests end up giving 406 Not Acceptable when proxied.

The proxy is a basic one, and just makes the same request as the client. When visiting the Webflow domain the site loads fine, it’s only when it went through the proxy it did this issue. I checked the headers of the requests and they’re all normal, and no issues with the size/length.

It lasted about 10 minutes one of the days earlier this week, and again today for about 6 minutes.

As you can imagine, it’s critical for me to work out what’s going on as my site is basically offline when this happens and I have no way to recover.

I’m wondering if Webflow are blocking the proxied request for some reason which I can’t work out. I forgot to take a screenshot, but it looked something like this (with the openresty appearing).

image

Just to note that I’ve been running this set up for about 2 months no with no issues.

Any ideas?

Regards,
Aki

1 Like

I recommend that you open a trouble ticket with the Webflow support team as should be able to answer what the cause is and any potential workarounds.

The very same problem, it was working fine for all this time.
Now I get the same error: 406 Not Acceptable openresty at our site: Economize

Not sure if it’s a problem with Workers or Webflow, but gets fixed in a certain interval like you suggested.

Interesting!

I think something has changed with Webflow that is causing this issue, but I have a feeling it is related to the fact the Accept header is not getting passed through the worker proxy.

When you make your fetch() in your Cloudflare worker, make sure to pass in the original request as a parameter.

E.g.

let response = await fetch(url, request);

My original code had

let response = await fetch(url);

This meant that the request headers of the client wasn’t actually getting passed down through the proxy, and the request that the worker did in the end did not include the Accept header.

Edit:
Seems to have resolved the issue.

1 Like