If you are getting the port number 80, and HTTPS, then something is strange in your environment. What does $_SERVER look like? Are you intending to run under HTTPS? Are you behind any sort of reverse proxy or caching server?
I am not sure what is happening on the Server of the provider. I attend to run everything under a https (for a more secure) connection.
Here are the server details. Let me know if this is of any use?
Is can see that the [“HTTP_X_FORWARDED_PROTO”] is ‘https’ but the [“REQUEST_SCHEME”] is ‘http’ and the [“SERVER_PORT”] is ‘80’.
Don’t understand how I have to ‘read’ this combination of data and is this okay or wrong?
Is it possible to adjust this code for the (future) Slim libaries or perhaps some extra code to bypass this in the bootstrap\app.php instead? (don’t fully understand what is happening at the server side).
Slim looks to be doing exactly what it is supposed to do. The issue is your server configuration as you are running HTTPS under port 80, which is not standard. You will either need to change your server configuration to run under the standard HTTPS port (443), or perhaps set a Twig global variable at runtime with your desired base URL.
In instances such as yours, the most common reason is that your server environment is running behind some sort of caching server or CDN. So while the request is HTTPS, the front caching server is HTTPS, but Apache behind the scenes is running on port 80.
What I do in similar instances is described in this post.