There are many threads about this problem. But none has my specific issue.

Intro to our setup: we run Nginx on port 80, which sits in front of Apache on port 8889.

We haven't changed anything in Nginx or Apache, and this setup has been working for a while. Which is why we're scratching our head for what happened to suddenly cause this starting this morning. We are now getting 500 errors in our website.

From looking at the log, I suppose they're not caused by Nginx but by Apache:

The logic is simple. For all files that are .htm etc in the root, we just show them. For any URL that starts with /beta/[xyz] we also show the file as it exists in the hard "beta" folder in the root folder.

But for all other URLs starting with our domain, we want to forward the code to /beta/get? with the parameter being that part of URI.