I am facing an issue with my Next.js (v13) app hosted on a self-hosted Kubernetes cluster. The AJAX JSON data calls from the _data directory are showing as 404 errors, even though when I directly visit the URLs in my browser, they load fine.
I'm perplexed by this issue, especially since everything seems to work perfectly in the development version of the site. You can check out the site here:
I am unsure where to begin troubleshooting this problem. Any suggestions or pointers would be greatly appreciated. As a reference, I've included my Next.js config file below:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
domains: [
'media.api-sports.io',
'media-2.api-sports.io',
'media-3.api-sports.io',
],
},
experimental: {
swcMinify: true,
},
compiler: {
styledComponents: true,
},
output: 'standalone',
};
module.exports = nextConfig;
Example of 404 Error:
https://i.stack.imgur.com/A1JdU.png
However, if you directly load the URL in your browser, such as this one: Click here, you'll see that the JSON file loads without any issues.