NGINX returning 404 error on a valid url

From OP:

It was a problem with the config file; I was conditionally setting expiration headers and disabling logging for images, js, css, ico files, etc. I had:

  location ~* ^.+(jpeg|jpg|gif|css|png|js|ico)${

and changed it to:

  location ~* \.(jpeg|jpg|gif|css|png|js|ico)${

Now when I request a url that ends in one of those strings, it parses it as a url, and not as a file, so no more 404 errors.