-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't figure out how to access tenant based on domain #259
Comments
You're using a subdomain AND a custom domain combined for I recommend you use |
Thanks for your answer @excid3. Following what you said I tried it with a naked domain (no subdomain) just |
Because it thinks you have a subdomain since there are 2 periods. You have to configure Rails for a tld_length of 2 if you're using a TLD like
|
@excid3 thanks for the info, before doing that I wanted to check if things would work with a domain with one period. So I used |
I am using acts_as_tenant to build a multitenancy rails app that deploys customizable websites. In my application controller I have :
Let's say my app is under
platformdomain.io
. When I create a new app, I can set a subdomain for it (let's say "me
") and the new website will be accessible underme.platformdomain.io
and this works perfectly fine.However I would also like my users to be able to deploy their app on their own custom domain like
customdomain.io
orshop.customdomain.io
.account
) calleddomain
. For testing purpose I bought a random domain (mycustomdomain.io
) and added it onheroku
shop.mycustomdomain.io
,heroku
then gives you a DNS target :randomDnsTarget
and I set up aCNAME
to point the shop subdomain formycustomdomain
torandomDnasTarget
.account
with a subdomain ofshop
and a domain ofmycustomdomain.io
.However when I try then to access the custom app at
shop.mycustomdomain.io
, I can see in the logs that my app is trying to load based on the subdomainshop.mycustomdomain
:Account Load (4.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."subdomain" = $1 LIMIT $2 [["subdomain", "shop.mycustomdomain"], ["LIMIT", 1]]
This can't work, as I guess the app should be trying to load the account with the domain of
mycustomdomain
. Am I missing something here ? Is this not how acts_as_tenant is supposed to work ? How can I achieve the described behavior ?The text was updated successfully, but these errors were encountered: