Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS: 400 Bad Request The plain HTTP request was sent to HTTPS port

I used AWS Elastic Beanstalk to setup my website. Requesting website through HTTPS is working but HTTP is responding with "400 Bad Request The plain HTTP request was sent to HTTPS port".

I have tried setting up an HTTP listener in load balancer to redirect HTTP to HTTPS following AWS docs but did not solve the issue.

I would appreciate it if someone could point me to the right direction, I'm not very familiar with AWS. Thank you in advance.

like image 891
Nate Avatar asked Jul 03 '26 19:07

Nate


1 Answers

The HTTP listener must be configured to redirect requests with all components present in the request (path, query).

HTTPS://#{host}:443/#{path}?#{query}

Status code: HTTP_301 (Redirect)

Listener

like image 144
Pippolino Avatar answered Jul 06 '26 18:07

Pippolino