Open Closed

Set tenant from URL is not working as expected #9752


0
ips-ad created

Prerequisites

  • What is your product version? -> 8.1
  • What is your product type (Angular or MVC)? -> Angular
  • What is product framework type (.net framework or .net core)? -> .net core

Hello,

I have one more issue regarding the hosting setup (hopefully more or less the last one ;-) ) and hope you can help me with this one, too. As per documentation (https://docs.aspnetzero.com/en/aspnet-core-angular/v8.1.0/Overview-Angular#multi-tenancy) I understand that we can have customers set their tenant via the URL for convenience, which is great.

Before the actual question please correct me if this is not correct:

  • tenant users can access their tenant login through tenant.coolapp.mydomain.com,
  • host users can access their tenant login through coolapp.mydomain.com..?

I am running separate host and angular pages behind separate NGINX containers (reverse proxy and SSL offloading) and tried the following configuration: Host (appsettings.Production.json)

[...]
    "ServerRootAddress": "https://{TENANCY_NAME}.coolapp.mydomain.com:4443/",
    "ClientRootAddress": "https://{TENANCY_NAME}.coolapp.mydomain.com/",
    "CorsOrigins": "https://coolapp.mydomain.com,https://*.coolapp.mydomain.com,https://{TENANCY_NAME}.coolapp.mydomain.com",
[...]

Angular (appconfig.production.json)

[...]
  "remoteServiceBaseUrl": "https://{TENANCY_NAME}.coolapp.mydomain.com:4443",
  "appBaseUrl": "https://{TENANCY_NAME}.coolapp.mydomain.com",
[...]

This is removing the tenant selection on the login page for host (coolapp.mydomain.com) and logging in fine for host, but giving CORS error for tenant.coolapp.mydomain.com. I also had a different setting where login via tenant.coolapp.mydomain.com worked, but ended up in host, too. Is there anything wrong with the configs above, anything to consider due to the NGINX reverse proxies? Before trying to set up the TENANCY_NAME feature I had everything up running smoothly (angular on http(s)://coolapp.mydomain.com and host on https://coolapp.mydomain.com:4443) with those proxies and didn't touch their configs since.

Thanks in advance for your support!


1 Answer(s)