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
preguntada hace 4 meses140 visualizaciones
1 Respuesta
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
INGENIERO DE SOPORTE
respondido hace 4 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas