Base solution for your next web application
Open Closed

How to host the Admin and Tenants on Subdomain? #8605


User avatar
0
optixdev created

Hi (Angular + .Net Core)

I have company website on mycompanydomain.com and www.mycompanydomain.com

I want to host all of ASP.NET Zero on sbdomain:

  • core.mycompanydomain.com (For the .Net Core App)
  • host.mycompanydomain.com (For the Admin)
  • tenant1.mycompanydomain.com (For Tenant 1)
  • tenant2.mycompanydomain.com (For Tenant 2)

These are my current configuration which is not working. Also when i am on tenant1.mycompanydomain.com the images are not displaying as its taking main webiste URL www.mycompanydomain.com where my images and css are not hosted.

File: Web.Host\appsettings.Staging.json "App": { "ServerRootAddress": "https://{TENANCY_NAME}.mycompanydomain.com", "ClientRootAddress": "https://{TENANCY_NAME}.mycompanydomain.com", "CorsOrigins": "https://{TENANCY_NAME}.mycompanydomain.com" }

File: Angular "remoteServiceBaseUrl": "https://core.mycompanydomain.com", "appBaseUrl": "https://{TENANCY_NAME}.mycompanydomain.com", "localeMappings": {

** Also, how to differentiate between Host and the Tenant?**

Thanks


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team
    • You should configure DNS to redirect all subdomains to a static IP address. To declare 'all subdomains', you can use a wildcard e.g. *.mydomain.com.
    • You should configure IIS to bind this static IP to your application.

    core.mycompanydomain.com (For the .Net Core App) The core subdomain will be redirected to the angular side. It should be another domain or subdomain.

    Please share the real url. If this is confidential, please share it to my email. [email protected]

  • User Avatar
    0
    optixdev created

    @maliming I have sent you an email.

  • User Avatar
    0
    maliming created
    Support Team

    hi optixdev

    I got your e-mail, thank you.

    Like I said before, your api should use a different domain or subdomain than angular.

    api: tenantname.api.mycompanydomain.com angular:tenantname.mycompanydomain.com

    api appsettings

    "App": {
    "ServerRootAddress": "https://{TENANCY_NAME}.api.mycompanydomain.com",
    "ClientRootAddress": "https://{TENANCY_NAME}.mycompanydomain.com",
    "CorsOrigins": "https://{TENANCY_NAME}.mycompanydomain.com"
    }
    

    angular appconfig

    {
      "remoteServiceBaseUrl": "https://{TENANCY_NAME}.api.mycompanydomain.com",
      "appBaseUrl": "https://{TENANCY_NAME}.mycompanydomain.com"
    }
    
  • User Avatar
    0
    optixdev created

    Thank you very much its working now.