user6247099
user6247099

Reputation:

Sub domain with Laravel and AWS

I have a site (let's say it is example.com) that is running a 'coming soon' page.

I am developing an app with Laravel and want to have a subdomain that I can upload the app while developing. So the main domain will keep showing the 'coming soon' page but the subdomain (let's say it is temp.example.com) will show the real app.

the domain is registered at namecheap

I am using AWS EC2 instance (with nginx)

And developing with Laravel 5.5

Looking online I saw some approach to handle this situation. What will be the best thing to do?

Thanks!

Upvotes: 0

Views: 615

Answers (1)

Kannaiyan
Kannaiyan

Reputation: 13035

Here are the following steps you need to take,

Route53: Add RecordSet with AWS. Update the DNS servers to namecheap. Since you plan to host your domain, better to create recordset for whole domain.

CloudFront Distribution: Whether you use CDN or not, it is better to wrap your domain with a CloudFront that will help to reach your EC2 server with less hops. Create CNAME and apply your CNAME to this distrubution.

Create Origin to your Nginix server.

That is your starting point.

Hope it helps.

Upvotes: 1

Related Questions