this post was submitted on 06 Jun 2023
19 points (100.0% liked)
Technology
37705 readers
336 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
Please correct me if I'm wrong, but here's what I think the situation is:
In that case you need both domains to connect to the same computer (because that's the one with that IP address) which routes it to the correct location (either on the same computer or on a different one).
You basically have two solutions (that you already mentioned)
1. single machine
2. different machines.
This is essentially the same, but instead of the services running locally, one or both run on different machines.
In both cases the IP address points to the machine running nginx.
If you can run both services on the same machine with docker, you should just use this: https://github.com/nginx-proxy/nginx-proxy
Thanks so much for the reply; others have mentioned the same, or similar, but your response spelled it out... I knew this was what I needed to do [scenerio 2] but I just didn't have experience with setting up the proxy - I'm technical enough to RTFM and will get this setup today; one thing that was kinda fudging me up was that my Bitwarden machine, where the domain currenty forwards to, runs in a docker container - so I think I'll actually forward the OTHER domain to the 'lemmy' [although its not lemmy, just using your example as the reference..] machine that's just an Ubuntu server running apache2 for serving the website - and I'll probably end up using Apache's Name Based Virtual Host Support instead of your nginx-proxy suggestion - either way, I think its accomplishing the same.
Appreciate your, and all the other, replies - this thread literally performed better than on the /r/ platform! I'm sold on LemmyNet!
Both nginx and apache are webservers and can do what you need.
Apache calls this Name-based Virtual Hosts. (see ServerName/ServerAlias)
Nginx calls this Name-based virtual servers (see server_name in the docs)
Either will listen on ports 80/443 on the IP and proxy the request depending on the hostname used. If you're not really familiar with either, I would recommend nginx. It's very popular, the documentation is good and the syntax is a lot better IMO.
I hear caddy is also a nice alternative with even simpler syntax, but I haven't used it myself.
Good luck!
I can see how you're not yet familiar with all these terms :p Both nginx and apache are http servers and work the exact same in your case.
The server (apache or nginx) listens on the IP on port 80 and 443. Depending on the hostname that is used to connect, the request is proxied to a different location. Apache calls this virtual hosts, nginx call this virtual servers