Hi All,

I am trying to figure out how to configure different domains for different tenants, example:
Tenant 1 - app.tenant1.com
Tenant 2 - app.tenant2.com

From other threads I have seen this video suggests a routing page:

https://www.youtube.com/watch?v=b-yG6hQ7hdk&feature=youtu.be&t=1889 


Any ideas how to define the SEO Rules + DNS to enable the different URLs in this example? 



You can either use IIS to route your external addresses to your internal pages, or use the native SEO rules configuration. Take a look at this page: https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/OutSystems_Platform_SEO_Friendly_URLs

Hi Joao, I am using MS Azure with the OutSystems Azure templates (on prem)...

I am slightly confused as to where I point the DNS of each subdomain also do I need to make any modifications to the app gateway. I am also confused how we pass the tenantid...  any suggestions. I have tried playing around with it bit no luck so far.

Hi André,

There's a few sides to your question here. I'll try to address them separately:


1) DNS - Your infrastructure guy will need to register whatever number of domains (let's say 2: tenant1.com, tenant2.com) with a registrar and point them all to the same server, the OutSystems server. This is all internet-wide generic stuff: Nothing here is OutSystems-specific or, indeed, does the OutSystems server know how to handle this. This registrar configuration just needs to make sure requests to BOTH domains get to the (same) server;

2) SSL Certificates - Once the requests get to the OutSystems server, it will need to be able to "accept" HTTPS requests from both domains. Make sure that you have a SAN certificate installed into OutSystems (in LifeTime) capable of "signing" both domains;

3) SEO - SEO rules unfortunately don't allow any automatic tenant-routing, depending on the inbound URL (only "what app is at the root of the server, when accessed with tenant1.com", not "what tenant should be used on the server, when accessed with tenant1.com");

4) Multi-tenant routing - since OutSystems 7 the tenant to be used is set automatically dependent on the LOGGED IN user (not a different URL). You can set it manually though using the (System) action "TenantSwitch", even if the user is anonymous.


My suggestion to implementing something akin to 3) having in mind 4) is to implement the OnSessionStart session event action, and in there call TenantSwitch to switch to the tenant appropriate to the domain that got the user here on this (first) request. You can probably use the GetURL() function inside the HttpRequestHandler extension to get the requested url, extract the hostname and put your logic on top of that.


Miguel