I'm trying to implement HTTPS in my application. It is a JHipster/SpringBoot app which runs on port 8080. I implemented HTTPS via AWS, to make things easier because the certificate could be handled/renewed automatically by the AWS certificate manager service.
So I didn't change anything on my server. I generated a certificate on AWS and configured a LoadBalancer rule to redirect from 443 to 8080 using the generated certificate. When I try access my domain using explicitly HTTPS it works like a charm.
The problem is that I also want to redirect HTTP access to HTTPS, then I tried to add a rule to redirect 80 to 443, so it would fall in the first rule (443 to 8080) and use the certificate, but it doesn't work. Researching online I found I should add some lines to my .htacess file, but doesn't work also. I think that's not the solution in my case, since all the HTTPS stuff is on AWS side, is there a way to redirect HTTP to HTTPS only via AWS without changing my server?