this post was submitted on 06 Jun 2023
19 points (100.0% liked)
Technology
37729 readers
67 users here now
A nice place to discuss rumors, happenings, innovations, and challenges in the technology sphere. We also welcome discussions on the intersections of technology and society. If it’s technological news or discussion of technology, it probably belongs here.
Remember the overriding ethos on Beehaw: Be(e) Nice. Each user you encounter here is a person, and should be treated with kindness (even if they’re wrong, or use a Linux distro you don’t like). Personal attacks will not be tolerated.
Subcommunities on Beehaw:
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Thanks for the three replies so far; BTW, Lemmy is beating out /r/eddit on this thread!!! :P
Yea, I know that I'm needing a reverse proxy - it was just how to implement one since the two sites aren't using the same host software; apache2 and nginx... so I think I should run a 3rd VM and route the traffic out to the other 2 local IPs; OR condense the two sites into one VM - which I don't really want to do...
Or, maybe I pick a [free, paid if needed] Cloudflare tunnel for the lesser used site - and only have to forward to one VM from my IP.
I guess one more solution would be switching the apache2 over to nginx - can I route to a separate local IP from nginx reverse proxies??? Will research...
Thanks for thinking this thru with me - and I'll keep checking back for other suggestions. :P Appreciated!
With Cloudflare tunnels, I found I could only authorise one top level domain (perhaps multiple is a paid feature, I'm not sure), but I found I could run a second cloudflared in docker to authorise the second.
If you're running VMs, you can probably use tunnels no problem, with Cloudflare routing to the appropriate domain.
If you're against Cloudflare, there should be no reason you can't have nginx grab all traffic then forward the request to your apache2 server based on the host name.
I'd only need Cloudflare for one of the sites/VMs; or, both if it'll handle it easily - I'll be hosting both sites on my hardware. No sites data will be on Cloudflare, I was only thinking about using a tunnel from them to take care of one, or both, the sites.
Thank you for the reply - I'm blown away that I've gotten all these suggestions on LemmyNet before one reply on /r/!
Reddit has loads of people asking and not enough answering. Lemmy has lots of new users and not enough posts to answer, so you got lucky :)
The spirit of (small) community shines here, it would seem 😀
YES; I am loving the LemmyNet; I'll be here for awhile.
It doesn't matter what the 2 sites are using for your reverse proxy in the front. All you need to do is have a simple reverse proxy up front - I use HAProxy - that routes to one or the other VM's IP address and port for its server based on the hostname coming in. That way, Site1 will receive all the traffic for Site1 as if it had been contacted directly, and Site2 will receive all of its own traffic too.
The web servers all speak the same language - they're just forwarding on HTTP(S) requests, not communicating in any special way between each other.
I mean, if you already have nginx OR apache, you could set up a vhost with the other domain name and do a proxy_pass or similar thing to the other one?
They don't need to be the same host software, you'd just need to configure one of them to know how to route it to the other instance. It's just plain HTTP(s) after all.
Reverse proxying is a feature in both nginx and apache after all. Though I'd recommend using nginx for that.
OK ; this reply gets traction with me... YES; I can get either site up; right now the bitwarden.domain1.com is live, and the domain2.com isn't getting ports - but I could switch that around... making domain2.com active/live - then yer saying I could use apache2 vhosts to route bitwarden.domain2.com traffic to a different local IP? Thats exactly what would work easiest for me - I can figure out apache2 vhosts... only I only have experience routing to two sites on the ONE apache2 instance; if I can pass that bitwarden.domain1.com traffic to an external local IP [another proxmox VM running the bitwarden container] that would be perfect.
You could use apache2 vhosts to route bitwarden.domain2.com traffic to wherever the heck you want. Even to another server on the internet.
Think of a vhost as uh... another set of apache server configuration that ONLY applies if the incoming traffic is for that domain/hostname.
That's determined by the Host header in the request, or the TLS SNI value if you're using HTTPS.
Then in that vhost, you'd just configure it like you would any apache instance, like say, for the root location, have it do a proxy_pass, etc.
I'll give you an example of my setup.
Every server has it's own instance of Nginx Proxy Manager (not needed, but helps with using docker networking), then every service I run on docker, I just use docker networks to talk to the rproxy.
My network is designed such that all my externally available services are on one server, so I just forward 80 & 443 to that.
For every other service (not on docker), I just use 127.0.0.1 + port.
For services on other servers on my LAN, I use Internal IP + port.
Understood ; I run all my services on different Proxmox VMs/containers... this isn't usually an issue until two needed the same 80/443 ports... I suppose I could change the ports for my Bitwarden, as I'm the only user connecting [aside from a partner or 2...] and I could modify the links used to connect accordingly.
I feel like I'm missing some EASY thing; like can't my apache2 just route the bitwarden.domain1.com traffic to another local IP address...
All these replies are helping - I just gotta pick the solution and GO; just trying to find the easiest, best solution.. :P
Yes. It can. https://httpd.apache.org/docs/2.4/vhosts/name-based.html
Thankyou for the link - I'm good at Linux stuff w/ the right info - trust me, I've tried to find this data... :P
Appreciate yer help!