0

My rails application currently works as follows:

In the database, there are tenants, also known as 'companies'. Everything in the database belongs to one of these companies, and so have a company_id attribute in order to separate them.

My application determines which company to use based on the subdomain in the link inputted by the user, so for example:

apple.myapplicationsnamehere.com

Should look at the companies in my database, and find out which one is called "apple", then separate all of the data by apples ID.

This works fine on the localhost (if you're wondering how this is possible, I used a redirect to my localhost that I found online - http://apple.lvh.me:3000/)

However, this does not work on Cloud Foundry.

I have tried to use vmc's map function to create the Url: apple.myapplicationsnamehere.cloudfoundry.com, but this does not work, and simply appending a subdomain to my application doesn't work either.

Does anyone know of any way around this? Or perhaps I'm missing something? The database was seeded with caldecott already, so the companies certainly exist in the database.

4

1 回答 1

0

您应该能够运行:

vmc 映射 myapplicationnamehere apple.myapplicationsnamehere.com

vmc 映射 myapplicationnamehere orange.myapplicationsnamehere.com

vmc 映射 myapplicationnamehere pear.myapplicationsnamehere.com

虽然我不相信您可以设置通配符匹配,但每次将新公司添加到您的环境中时,您都需要运行 vmc 命令。

于 2013-05-11T14:55:54.490 回答