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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠