I configured and enabled SSL and everything worked fine. But after enabling redirection from http to https I get the following error when opening the website:

Bad Request
Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

I noticed this only happens when visiting the site by typing mywebsite.com on the browser search bar and when I visit it, the url shows up like this: http://mywebsite.com:443/

If I remove the :443 part it works properly and redirects to https.

How can I make it so it doesn't go to the wrong url when visiting from the browser? At the moment I've disabled the redirection to avoid my clients trying to come back to the site and getting that error.

The issue here is the initial HTTP request. This does not work as the server does not understand it receiving the request on port 443 (if no port is provided, http default port is 80, and https port is 443).

Your lines above seem to be ok. Did you add them inside <VirtualHost _default_:80> tag in /opt/bitnami/apache2/conf/bitnami/bitnami.conf file?

We have a Support Tool that will gather relevant information for us to debug the issue. Could you please download and execute it on the machine where the stack is running by following the steps described in the guide below? You must click on the platform or cloud that you are using to find the correct instructions.

This is the code: 114ecfe9-283d-64c6-35d6-f4f030a6899cYes, I added the config to the bitnami.conf file and inside the virtualhost you pointed out.Right now I removed that config since we don't want to have that error showing up to our clients.Thanks in advance.

Also, in the support tool's report the apache access log was missing. Could you restart the apache and see if the log is generated when you browse the site ?. I would like to have that file, so I can see the request that apache is serving.

That's the Apache module that handles this type of redirection rules. It's normal that it matches the rule. I was expecting to find the rule on other files that were modifying the redirection behaviour..

Do you have any .htaccess file? They might be the root of the issue. Could you run the command below and share the output?

You're using your own custom PHP app, aren't you? Could you check whether you generate some redirection in the PHP code or you create any link based on the port? It could be related with the redirection to login.php file:

Hi @jarizaAfter looking all around the app, I managed to find the problem. The app uses a forward method that built the location like this: http://$domain:$server_port, and since it didn't check if it was https, it was adding 443 port to plain http. Since the person that developed this doesn't work with us I didn't know how the app worked (or anything related to Bitnami) and it took me a while until I found this. I'll fix it and test if that was the problem.Thanks everyone for the help and sorry for wasting your time.