I can deploy Angular to Azure Web Apps on Linux service plan and it works fine when hitting {myapp}.azurewebsites.net/index.html
I can navigate inside the app as expected.
When hitting the root {myapp}.azurewebsites.net it just displays the hostingstart.html.
It does not help to remove the hostingstart.html as suggested in some articles.
If I try to hit a sub page url directly (like {myapp}.azurewebsites.net/mypage) then I get an error : Cannot GET /mypage (this works when I run locally)
I suspect that i need to setup a default page, but i cannot find this anywhere in the Application Settings in the Azure Web App. (I think this is only available on Windows service plans - not on Linux Service Plans).
How do i deploy properly to Linux App Service for this to work ?
I have found a lot of articles on the issue, but they all seem to cover Windows App Service Plan.
You need to add URL rewrite rules to the Apache server so that any page request gets redirected to Angular's
index.html
Paste this into your root
.htaccess
file:(Source: https://github.com/angular/angular/issues/11884#issuecomment-288852433)
EDIT: If using a node.js backend, see this SO answer for reference: https://stackoverflow.com/a/34864585/235648