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
asked 3 months ago117 views
1 Answer
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
SUPPORT ENGINEER
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions