How to Create Subdomain in AWS with Route53

How to Create Subdomain in AWS with Route53

In this article, we will see how to create subdomain for your application with using AWS EC2 and Route53.

What is Subdomain?

A subdomain is a website that is a part of another website.

A subdomain can be used to create an additional site, such as a company’s blog or to create an additional email address for the account holder.

Create Subdomain in AWS with Route53

Select Route53 from the services and select your domain hosted Zone from the list

Click on Create record.


SSH to your instance

Create a Virtual host:

Go to /etc/nginx/sites-available, which will list all available virtual hosts, to create one use below command:

 sudo touch
	listen 80;
	listen [::]:80;
	location /
		proxy_pass http://localhost:8083;#whatever port your app run
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection 'upgrade';
		proxy_set_header Host $host;
		proxy_cache_bypass $http_upgrade;

Now To activate created virtual hosts, run the following command:

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Now restart the nginx using below command:

sudo service nginx reload

Add SSL:

sudo certbot --nginx -d

Subscribe to our Newsletter

Stay up to date! Get all the latest posts delivered straight to your inbox.

If You Appreciate What We Do Here On TutsCoder, You Should Consider:

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Leave a Comment