Base solution for your next web application
Open Closed

.net core and angular deployment over https #7063


User avatar
0
sumitshah created

Hello All,

We are trying to deploy a website developed using aspnetzero in angular and .net core.

Have recently upgraded the aspnetzero framework to 6.9.1 and are following the below steps to deploy it in IIS:

  1. Publish the host project which generates both the server side dll's as well as angular bundles.
  2. GOTO IIS and create two separate websites one for server and other for client
  3. Create two separate folders and copy the server code in one and client code in other
  4. Point the websites to respective folders
  5. Make the required changes in the appsettings.Production,json (for server) and appconfig,Production.json (for client)
  6. Apply certificate (signed by COMODO) to the client and define https bindings for both the client and the server in IIS

Doing all this setup we are able to browse the application but when we hit the URL it is showing the site is not secure (as shown below).

We have already gone through the deployment steps mentioned on the aspnetzero documents portal but they are very basic and are not helping in solving our issue:

https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Deployment-Angular-Publish-IIS#angular-application-publishing

While doing this deployment we have a come up with few queries:

  1. How do we deploy client and server as two different secure (https) websites in IIS
  2. Will we be requiring 2 separate SSL certificates, one for the server and other for the client.

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    SSL certificates are related to domain names. If your certificate is a multi-domain certificate or a wildcard domain name (such as .*aspnetzero.com) you can use multiple websites. Otherwise you may need a separate SSL certificate for each domain name. (Can be in SSL provider Learn more)

    When your browser prompts are not safe, can you look at the detailed reasons? You can click on the browser's [Not secure] to view the details.

  • User Avatar
    0
    sumitshah created

    Thank you we were able to deploy using valid ssl certificate. The issue was with setting up the configs

  • User Avatar
    0
    lweng567 created

    Hi I am facing the similar issue. I got my certificatte set up on both Client (angular)and Server(Core API). The CorsOrigins setting in appsetting.json is using ip address, if my certificate is signed to www.rtime.com.au and my accessing url will be www.myco.com.au:4432 to my anguar client, do i then change the CorsOrigins to the www.myco.com.au, like

    "App": { "ServerRootAddress": "https://www.myco.com.au:4439/", "ClientRootAddress": "https://www.myco.com.au:4432/", "CorsOrigins": "https://www.myco.com.au:4432" },

    thanks
    Laurie