I currently have my NextJS site and my domain hosted with Vercel, which provides a SSL certificate for my domains.

My web application is on mydomain.com and my backend domain is backend.mydomain.com

Since my backend is in EC2, I tried to set up a AWS Load Balancer to make HTTPS requests from my frontend to backend.

Should I set up a HTTP/HTTPS load balancer, or a TCP load balancer? AWS keeps asking for my certificate, but I do not have it, since the details are hidden from my by Vercel.

Will I have to contact them to get more details?

  • I'm confused. What / where is your front end - is this a static single page or hosted somewhere? How does the Vercel SSL cert come into this? Typically you would just create a certificate with AWS Certificate Manager, associate it with an ALB, and point the ALB at your EC2 instances. – Tim Oct 8 at 18:58
  • The frontend is a NextJS application hosted by Vercel. I thought the Vercel SSL would be related because the backend.mydomain should have a Vercel cert already and I wouldn't need to use one for the ALB.... right? – Jon Tan Oct 8 at 19:12
  • Ok. The front end hosting and back end hosting are completely independent. – Tim Oct 8 at 21:38

From what you've said your front end is hosted by Vercel, your back end by EC2. They're completely independent from a load balancing / certificate point of view.

I suggest:

  • Create a certificate for your back end server using AWS Certificate Manager (ACM). Alternately you can import an existing SSL cert into ACM, but then it won't re-issue automatically.
  • Create an AWS Application Load Balancer, and associate it with the new ACM cert
  • Ensure your load balancer directs traffic to your EC2 instance. You can use auto scaling or do it manually, your call.

In comments you mentioned you can't use ACM because you already have a cert issued elsewhere. You can have multiple CAs issue a certificate for the same domain. If you're having a problem with certificate issuing please create another question that's much more detailed.

| improve this answer | |
  • I see what you mean. However, I am unable to create the certificate with ACM because backend.mydomain.com already has a certificate created by Vercel already. The request fails with a "CAA Error" – Jon Tan Oct 8 at 22:20
  • My frontend is hosted by Vercel and my backend is by EC2. However, the backend.mydomain.com is managed by Vercel and that's been throwing me in a loop since I don't know where I am supposed to reuse my Vercel Certificate or not – Jon Tan Oct 8 at 22:27
  • 1
    You should be able to issue a cert from ACM even if another place has issued a cert. It's not like having a cert done blocks another being done. If your core problem is issuing the certificate suggest you ask a new question and give a lot more technical detail including environment and details of the error message. You can also import an external certificate into ACM, answer updated in a minute. – Tim Oct 8 at 23:59
  1. You need to host your site on Ec2
  2. You need to add your SSL certificate to your site.
  3. Then use HTTP/HTTPS Load balancer.
| improve this answer | |
  • I don't think that's right. Hosting on Vercel shouldn't be the issue. I think the way to proceed is to create a certificate for ALB but I'm not sure what to fill it when it asks for my domain – Jon Tan Oct 8 at 20:50
  • That's an imprecise answer which I'm not sure is correct. – Tim Oct 8 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.