I have a little dilemma. I recently upgraded to a more powerful server and created a new subdomain new.example.com for my latest project. It uses Docker. The problem is that my two other websites example.com and shop.example.com cannot run when the new one is running, as I must kill all processes on port 443 to allow Docker to occupy it… I have tried to move Apache to port 8443, but it isn’t making a difference. I have also tried to relax Cloudflare SSL settings to Flexible, however this just leads to other errors.
I either get redirects to the new subdomain or it gives 521 errors.
Can anyone help? I’m relatively new to self hosting and I am clueless.
You need a reverse proxy container, one that can listen on 443 and direct requests to the appropriate container.
I’m a fan of Traefik for docker scenarios. It’s a little complicated compared to something like nginx, but is indirectly flexible and powerful.
Here’s my config as a starting point, the docs for Traefik are pretty good.