this post was submitted on 06 Jun 2023
19 points (100.0% liked)

Technology

37729 readers
72 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
 

Hello, all. I'll start this post off with - this is a test. :P I have the same topic posted at /r/... seeing if I get any l<3ve over here!!! I hope so!!! LemmyNet for the WiN!

I have two domains that I pay for... lets call them domain1.com and domain2.com. I'm running a Bitwarden docker container that uses nginx to serve the website... its address is bitwarden.domain1.com .

I'm running a HUGO website with Apache2... its address is domain2.com .

I have one local IP address; currently, I forward ports 80 & 443 to the local IP of the Bitwarden VM. So... thats my issue; I don't understand how to forward these two different services to the domains that I want them on... I've read about Apache2's vhosts - but the websites are on different VMs, and the Bitwarden docker container uses nginx.

I've thought about condensing and putting both services in one VM; but theres still the apache2/nginx issue. I've heard someone mention I should use a third VM to route the traffic to the correct local IPs - but I don't know what software I'd use.

I've thought about using a Cloudflare tunnel for one of those services; but I don't really want to pay, and aren't sure how fast a free Cloudflare tunnel would be - this might be a solution for the Bitwarden service, as I'm the only one accessing it...

Does anyone have any suggestions? I'm sure I'm just novice enough that I don't see the obvious solution - and I'd love to get both sites up and running. Thanks for any input or help!!!

pAULIE42o . . . . . . . . . . . /s

you are viewing a single comment's thread
view the rest of the comments
[–] paulie420 2 points 1 year ago* (last edited 1 year ago) (13 children)

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!

[–] 0spkl@kbin.social 2 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] paulie420 2 points 1 year ago (1 children)

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.

[–] 0spkl@kbin.social 2 points 1 year ago

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.

load more comments (11 replies)