Multiple websites and port 443 reddit / selfhosted ---------------------------------------------------------------------- HolidayAstronomer843 · 2023-10-08 09:07 I have a little dilemma. I recently upgraded to a more powerful server and created a new subdomain new[.example.com](https://trade.example.com) for my latest project. It uses Docker. The problem is that my two other websites [example.com](https://example.com) and [shop.example.com](https://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. ---------------------------------------------------------------------- signed- · 2023-10-08 09:15 What you are looking for is a reverse proxy, which will redirect traffic depending on the subdomain Like [Traefik](https://traefik.io/traefik/) (recommended if you are using Docker/Kubernetes for your services), [Caddy](https://caddyserver.com/) or a more user-friendly [NGINX Proxy Manager](https://nginxproxymanager.com/) ---------------------------------------------------------------------- Spectryx · 2023-10-08 09:16 Do some reading on hos reverse proxies work, my personal favourite is Caddy but there are several good ones ---------------------------------------------------------------------- ElevenNotes · 2023-10-08 09:29 Start with nginx as reverse proxy, and work yourself up from there to traefik and haproxy. There is no single best solution, a mix of different proxies for different purposes works best. ---------------------------------------------------------------------- certuna · 2023-10-08 09:46 Different containers have different IPv6 addresses, so you can run multiple servers on 443. ---------------------------------------------------------------------- apcyberax · 2023-10-08 09:57 haproxy to create a reverse proxy to the docker ports you are using for the sites ---------------------------------------------------------------------- lilolalu · 2023-10-08 10:09 The advantage of traefik and caddy over haproxy and nginx, especially when using containers, is that it is VERY easy to integrate letsencrypt certificate generation and automatic updating. ---------------------------------------------------------------------- No_Dragonfruit_5882 · 2023-10-08 10:30 Takes 2 minutes in haproxy to set it up. Inc. Email Monitoring ---------------------------------------------------------------------- lilolalu · 2023-10-08 10:32 Still it's easier in traefik. I am running haproxy for a lot of years so I think I have an overview on the matter :) ---------------------------------------------------------------------- No_Dragonfruit_5882 · 2023-10-08 10:52 Well one is a high availability proxy and one is a loadbalancer proxy for microservices. Got an overview aswell with both products. Haproxy defenetly gets you more cash to setup than traefik. Got an Overview on that matter ---------------------------------------------------------------------- lilolalu · 2023-10-08 10:54 I don't think the OP wanted or needs a high performance load balancer, or where did you read that? To me it seems like the simplest solution will be the best for his purpose and that is without question either traefik or caddy. ---------------------------------------------------------------------- No_Dragonfruit_5882 · 2023-10-08 11:06 Just tought since they do the same and haproxy is faster and has more options he should go with haproxy: Source: Cons of HAProxy Becomes your single point of failure Cons of Traefik Not very performant (fast) Complicated setup ---------------------------------------------------------------------- lilolalu · 2023-10-08 11:13 It's very easy to set up Traefik especially if you are comfortable with docker containers already like OP seems to be https://doc.traefik.io/traefik/getting-started/quick-start/ ---------------------------------------------------------------------- unistirin · 2023-10-08 11:31 Just dropping one more solution to the existing solution to run behind Haproxy/nginx. Create multiple network interfaces, run ur 443 port servers, and bind to only that particular interface, dont bind to 0.0.0.0. In this way, your machine is running multiple servers of the same port 443 but different bind addresses. (well this is how docker actually does) Now introduce a Haproxy or Nginx controller in front of these servers, create a rule in haproxy something like whatever traffic comes from shop.example.com forward to interface1:443, Admin.example.com to interface2:443, and so on. You can break SSL termination right in front of haproxy if you want, or you can do ssl_pass through and terminate by your application. ---------------------------------------------------------------------- YmFzZTY0dXNlcm5hbWU_ · 2023-10-08 23:05 There’s a great lsio image called swag that combines nginx and letsencrypt too. That’s my go to since I know nginx best. But yeah, any integration along those lines is a no brainer