Mapping subdirectory to lightsail instance

1

Hello,

I'm building a website (Nextjs) on example.com deployed with AWS Beanstalk. I'd like to create a second website on example.com/blog, a wordpress instance on Lightsail.

Do you know how can I map example.com/blog/* to lightsail and example.com to my EC2 instance ?

Thanks

質問済み 2年前851ビュー
3回答
0

To do that, you'll probably need a server of some kind that has a static IP and that has example.com associated with it. This server would be in front of Beanstalk and Lightsail and could route the traffic appropriately. You could manage such a server yourself or use a managed load balancer with some custom rules to do the job. Here's some info about ALB that might be helpful: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-update-rules.html.

Another option to consider is to host your blog at blog.example.com. That way, you could use a simple A record to point to the static IP of your Lightsail Instance for your blog. You could use another ALIAS or CNAME record to point to your Beanstalk app. Here's some more info: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-beanstalk-environment.html.

AWS
Alex
回答済み 2年前
0

I would use CloudFront for this. It gives you the ability to map URL paths to specific destinations (origins in CloudFront). You also get caching; global reach; the ability to use Lambda@Edge to manipulate requests and responses in (near) real-time; and lower data transfer rates from origins in AWS.

profile pictureAWS
エキスパート
回答済み 2年前
0

Thanks for your answers ! I managed to do that with another method that I'll describe below just so you know.

Don't hesitate to tell me if my method is not good, but it works so far.

回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ