1

I have a WordPress blog that serves niche content on domain.com

On a different endpoint, domain.com/api/ I have a completely different Node.JS API that doesn't regard the WordPress but I want to serve it from the same domain.

It is worth mentioning that we proiritize performance and speed above all.

My thought was the following :

Set up 2 EC2 Instances, one for the WordPress and one for the API (Maybe make the API a Lambda instance ?).

Set up an Application Load Balancer that will know how to route requests with a rule depending on the URL.

Is it the right way to go ? Should I just use nginx as a reverse proxy and serve the Node.JS API on a local port ?

I also want to use Elastic Beanstalk to save myself the headache of configuring the Load Balancer and the Auto Scaling group.

P.S If anyone has any advice or good habits on how to build those (With S3 Bucket perhaps, over CloudFront, etc etc) it will be more than welcome.

Thanks !

  • 1
    Somewhat different question, similar solution: https://serverfault.com/questions/729697/can-i-use-cloudfront-to-serve-a-wordpress-blog-from-the-same-domain-but-a-diffe – Michael - sqlbot Sep 16 '17 at 11:51

1 Answers1

1

How about 'wp.domain.com' and 'api.domain.com'? Any reason to not use subdomains? Then you can almost trivially solve your problem with DNS.