question

YigitCAlparslan-8532 avatar image
0 Votes"
YigitCAlparslan-8532 asked YigitCAlparslan-8532 commented

Nextjs Routes are not working when deployed to Azure App Service Linux Instance

I wanted to deploy a nextjs app to Azure App Service with Linux instance.

I followed the instructions here: https://developinjay.com/deploying-nextjs-app-to-azure-app-service-linux-77a43353e761
The app is live here https://interviewramp.azurewebsites.net and https://interviewramp.herokuapp.com.
Routes work in Heroku. So if user goes here https://interviewramp.herokuapp.com/books/interviewramp/introduction it works.
Routes don't work in Azure App service. So, if user goes here https://interviewramp.azurewebsites.net/books/interviewramp/introduction, I get 404 document not found error, which means code is trying to serve an introduction.html file in Azure and returning 404 because there is no html file like that.

All links work locally when I npm run start or npm run dev.
Pasting url like this to browser gives 404 : https://interviewramp.azurewebsites.net/login

I have never done next export in my code. I was wondering if you could help me?

azure-webappsazure-app-configuration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered YigitCAlparslan-8532 commented

Hi @YigitCAlparslan-8532,

Thanks for bringing this to our attention. I am not seeing the 404 error. I am able to see your site. This is what I see
202443-interviewrampsite.png



interviewrampsite.png (106.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello,
I was able to solve the problem by adding node server.js to my start up command instead of next start

0 Votes 0 ·