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
asked 4 years ago279 views
1 Answer
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
answered 4 years 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