CORS/HTTPS issues with Elastic Beanstalk and load balancer

0

We have a springboot backend api running on elastic beanstalk. Our domain is on route53 and uses the Certificate Manager to run as https.

To make an api request we send the request to a subdomain url (https://api.SomeWebsite.com ). In Route53 we direct that subdomain to an EC2 load balancer, which then points that at the beanstalk instance. Our beanstalk should be in http - we are using the LB as an SSL terminator.

We have listeners for incoming traffic on the LB as:

HTTP , Port 80 -> Redirect to HTTPS

HTTPS, Port 443 -> Redirect to Target, HTTP, OurBeanstalkENV.

I have triple checked that the https port points to the correct EB instance, and it does note http on the target selection. +

The Issue: we keep getting either preflight failed due to no Access-Control-Allow-Origin (it's in the request header) or a timeout error error when make the requests. When we look at beanstalk logs, our springboot server has an error: java.lang.IllegalArgumentException: Invalid character found in method name... HTTP method names must be tokens...

Based on this error Springboot is receiving httpS requests, even though it should be receiving http via the load balancer. Does anyone know what could be wrong here?

1개 답변
0

Make sure you are also configuring the redirection rule for the HTTP listener, see this guide for a step-by-step: https://aws.amazon.com/premiumsupport/knowledge-center/elb-redirect-http-to-https-using-alb/

AWS
전문가
Lucas_R
답변함 2년 전
  • If I have single instance environment, then how to do redirection from http to https without using load balancer, and certificate will be from Let's encrypt.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠