Base solution for your next web application
Open Closed

multitenancy resolver / subdomain #11287


User avatar
0
[email protected] created
  • What is your product version? 11.2.1
  • What is your product type (Angular or MVC)? ASP.NET Core MVC
  • What is product framework type (.net framework or .net core)? .net core

Hello,

am trying to detect the tenant through the sub domain, multi tenancy is enabled, and i have set the following

  • Web.Mvc Project
    • appsettings: "WebSiteRootAddress": "http://{TENANCY_NAME}.localhost:44302/",
    • WebMvcModule: Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat = "{0}.localhost:44302";
  • We.Public Project
    • appsettings: "WebSiteRootAddress": "http://{TENANCY_NAME}.localhost:44303/",
    • WebMvcModule: Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat = "{0}.localhost:44303";

I have a tenant called "clinic" and when i try to access "clinic.localhost:44302" or "clinic.localhost:44303" am getting a 400 error

any idea what could be wrong here? or how i can resolve this?


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It is hard to use subdomains locally on your computer. You can try to deploy the app to a local IIS on your computer (for example localhost:8080) and also you need to create mappings in your Windows host file like below;

    127.0.0.1 mywebsite.com
    127.0.0.1 clinic.mywebsite.com
    

    Then, you can visit the website like clinic.mywebsite.com:8080 which should work for the clinic tenant.