Reputation: 611
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.
They have their clients create a CNAME
record that points clients.theirbrand.com
to something like clientaccess.ourcompany.com
.
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:
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.
Upvotes: 5
Views: 2589
Reputation: 129
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:
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
Upvotes: 5
Reputation: 611
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.
Upvotes: 2