Functions give 404 on production

Hello everyone,

My nuxt website works perfectly locally, but in production, online, all functions give 404.
For example, visiting https://asktheright.com/api/blog it should display ‘’{type: “notification”, message: “ApiError: Blank referer not allowed”}, but a 404 error is found instead. What is wrong? No configuration is needed except the simple routing “/functions/api/blog/index.ts” (that works perfectly locally).

Thank you.

Hi there,

An HTTP 404 error is a client side error that means that the origin web server couldn’t find a requested file. Cloudflare does not generate 404 errors, so this would indicate something is not configured correctly at your hosting provider. It’s possible that a document root with your origin is pointed to the wrong host name or different working directory.

You should be able to find these errors 404 in the access logs of your origin web server.

The best next steps would be to work with your hosting provider to identify what potential misconfiguration could be in place that would cause the origin to look for a file where it doesn’t exist.