Multi tenancy laravel app hosted on elastic beanstalk environment

0

Question is related to the sub domain that I pointed to the EB environment domain from CloudFlare. The issue is how can I identify the tenant based on sub domain?

In my localhost environment I created a Virtual host by editing the host file like this 127.0.0.1 netlink after creating the virtual host I can ping to that api endpoints like this netlink:8000/api

How can I achieve the same with domain like this netlink.mydomain.com ? In here netlink is the sub domain created for the tenant in CloudFlare host ( CNAME record ). netlink.mydomain.com this domain being pointed to the Elastic Beanstalk domain.

Do I need to create VH in every sub domains in AWS ?

Note: I'm using the laravel tenancy package to create tenants. https://tenancyforlaravel.com/docs/v3

Asela
已提问 4 个月前140 查看次数
1 回答
0

Hello,

As you mentioned that you have created netlink as subnet and that was created for the tenant in CloudFlare host ( CNAME record ). netlink.mydomain.com this domain being pointed to the Elastic Beanstalk domain. So you have to create similarly for all subdomains and point them to beanstalk. Please note that route 53 is a dns service and didn't understand host redirection or http headers.

For example you can have sub-domain configuration like below :

netlink.mydomain.com A (Alias) XXXXXXXXXXXXXXXXXXXXelasticbeanstalk.com.

XYZ.mydomain.comA (Alias) XXXXXXXXXXXXXXXXXXXX.elasticbeanstalk.com.

Hence I will suggest you to please have to look on how to create subdomains here

Thank you!!

AWS
支持工程师
已回答 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则