Base solution for your next web application
Open Closed

Hosting Angular App in Azure Web App Virtual Directory #10050


User avatar
0
Hammer created

Product in V10.0 aspnet.core / Angular

When deploying the Angular part of the application under a virtual directory, I get a blank page. Exploring the page, I see that the html part has loaded, but all the scripts and css could not be found. The message I get in chrome developer tool: "Refused to apply style from 'https://www.xxxxx.com/Error?statusCode=404' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."

My dist files are located under https://www.xxxx/my-virtual-directory, but chrome's developer tools tells me it wants to load them from https://www.xxxx.com.

My appconfig.json looks like: "remoteServiceBaseUrl": "https://www.xxxx.com/my-virtual-directory-server/", "appBaseUrl": "https://www.xxxx.com/my-virtual-directory/",

It seems this could be related to this issue: https://support.aspnetzero.com/QA/Questions/4352/AppPath-issues-with-Core-under-IIS-Virtual-Directory

How to solve it remains unclear.

Could you please help me?


1 Answer(s)
  • User Avatar
    0
    Hammer created

    In the end, I opted for an Azure CDN hosted angular app with a custom domain, and it works like a charm.