I am trying to host a nextjs website on iis here is my set up .
Contents of web.config which causes nextjs site . On access of http://localhost/AppWithNode1/SimpleErrorView it should redirect to the nextjs site.
On navigate to the http://localhost/AppWithNode1/SimpleErrorView it shows the nextjs 404 error page
the console shows 404 for the js and css assets too.
Edit:
Output from the port hosted via httpplatformhandler
I tested the code you provided and I found that in your nextjs.config.mjs
, the value of basepath
is still FormsApp
, you need to check if it matches your case.
I also had a situation where static resources couldn't be loaded correctly(404 not found error), but the page.tsx
works, I tried using standalone mode and then rebuilding it and it worked, I think you can try it too. Something like this:
next.config.mjs
module.exports = {
output: 'standalone',
}
If this still doesn't work correctly, try creating a plain nextjs app, build and deploy it to see if you have the same problem.