EC2 Misconfiguration lead to SSL_ERROR_RX_RECORD_TOO_LONG

This problem already take days for me to search the solution. I already search in this page but only empty result.

I even don’t know where the problem starts. But the chronology is:

  1. I make Ubuntu20.04 Server t2.micro EC2 instance
  2. Only have 25GB storage
  3. Configure the security group as open as posibble like this:security config
  4. After launched, i’m installing nodejs 14.17.5
  5. run npm install
  6. My app run on port 8000.
  7. I go to my-ec2-public-ip-address:8000/ display only json message
  8. When i go to my-ec2-public-ip-address:8000/login i only get the html (no css, img, etc )

in the network tab, this is the screenshotssl_error_screenshot

but when i test the static file, for example my-ec2-public-ip-address:8000/styles/style-login.css the server returning correct css file.

if you want to see the source-code, let me know in the comment, because i don’t think it will help much. Because my guess is the problem exist on the server configuration. When run locally, everything normal