Problems mapping specific folder as a subdomain with Elastic Beanstalk

0

Hi,

We have Elastic Beanstalk instance (Platform: Python 3.6 running on 64bit Amazon Linux/2.6.6) and we're building Django applications. Our root domain is working just fine, but the problem is how to map subfolder (different Django app) as a subdomain of that root domain (e.g. https://rootdomain.com/folder/ -> https://folder.rootdomain.com/). Which is the best or easiest way to do it? We've already tried with S3 buckets and some VirtualHost definition to .ebextensions config, but nothing seems to work.

N3_team
已提问 5 年前295 查看次数
1 回答
0

Well, I solved this problem by myself, but wanted to share if some else is looking for solution. So, we have one EB instance with multiple Django applications and our need is to show those applications under different subdomains.

The fastest way is to add "folder.rootdomain.com" A alias to the DNS records (Route 53) which points to the root domain of the EB instance.

Then you just add your own middleware class to the django project with custom "process_request" implementation and replace request.urlconf with the urls of the specific application and done!

N3_team
已回答 5 年前

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

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

回答问题的准则