Looking for a working code ignitor nginx rewrite

Hi I tried launching a new site of mine the other night and it had
issues with the rewrite.

So I was forced to pull my site offline and swap to an older version.

Basically none of my directories would load, like /forums/ would give me
a 404 and /admin/ would but the rewritten pages would load fine.

I would like it to simply serve the files in my
uploads|images|js|stylesheet directories without looking up rewrites,
and then have it serve my cache files, and then if nothing is found load
the normal page.

I’m wondering if anyone can look at my rewrite and tell me a
better/correct way to do it.

If anyone has done this and can help please do, I’m lost as to what i
did wrong so far.