How can we provide a custom domain name for our clients?
Asked Answered
I

2

5

We currently have a SaaS application that lives at app.ourcompany.com. I am trying to understand what it would take to let our clients access our application via a custom subdomain like clients.theirbrand.com.

I have done some research and there seems to be a few things in common with other companies that provide this.

  1. They have their clients create a CNAME record that points clients.theirbrand.com to something like clientaccess.ourcompany.com.

  2. Or the application has client subdomains (clientname.ourcompany.com) in which case they have the client create a CNAME that points clients.theirbrand.com to clientname.ourcompany.com

I tried taking one of our extra domains and pointing app.extra.com to app.ourcompany.com via CNAME but it just redirects to app.ourcompany.com.

My question revolves around what we need to do to facilitate this, specifically:

  1. What needs to be done on our clients end via DNS? (just CNAME?)
  2. What needs to be done our end via DNS?
  3. How would we incorporate SSL? (We currently use lets encrypt on app.ourcompany.com) We can secure our side but do clients have steps to take as well?

Update: We are using nginx to serve the application.

Ingridingrim answered 15/3, 2018 at 17:17 Comment(0)
A
5

I know its a little late but I was stuck in a similar situation and thought it might be helpful for newbies like me :)

Have a look at: OpenResty

We have two requirements:

  • allocate a subdomain to all new customers (e.g: trumptower.mibuilding.eu)
  • allow customers to bring their own domain (my.trumptower.com)

The first one was pretty easy with Lets encrypt's wildcard subdomain ssl.

The second one was tricky. Since we needed to not only issue an SSL on the fly but also configure our gateway (haproxy at that time) and reload the configuration terminating all active sessions briefly. Mind you, HAproxy and nginx wasn't able to coup with dynamic configurations.

Openresty with lua plugin allows us to do everything above automatically and on-the-fly.

The module we used was: lua-resty-auto-ssl

Alabaster answered 16/1, 2020 at 19:36 Comment(2)
Thanks for answering. Can you add a little more info from your link that is related to the original question? That way your answer will be more helpful to others.Habakkuk
@Habakkuk thanks, its done. I don't know why it wasn't completed yesterday.Alabaster
I
2

So I finally figured this out.

Step 1. Have your client setup a CNAME record that points their.domain.com to your app.saas.com

Step 2. Add their.domain.com to your nginx server block: `server_name app.saas.com their.domain.com; and reload nginx

I am now working on setting up SSL for the extra domains and will comment when I figure it out exactly.

Edit: SSL is working with a SAN Let's Encrypt certificate installed on the server.

Ingridingrim answered 16/3, 2018 at 18:39 Comment(1)
This is definitely not an option when it comes to scale! I don't want to go and edit nginx conf everytime and reload it whenever a new client comes.Lordinwaiting

© 2022 - 2024 — McMap. All rights reserved.