Score:0

Create a containerized reverse proxy with multiple sites on a separate IP Address

cn flag

I administer a small cluster which has several different services running, including grafana monitoring as a container, cloud file storage as a container (nextcloud), and a FreeIPA server on bare metal. I want to put the cloud storage service behind a reverse proxy (https://hub.docker.com/r/jwilder/nginx-proxy) to enable https, but I can't use port 80 for this, because it's already being used by the IPA server.

I know it's possible to assign a public IP address to a container (I've used this before to do it https://blog.carroarmato0.be/2020/05/08/exposing-podman-container-on-the-network/), so I'm curious if I could assign a public IP to the reverse proxy, and have the proxy refer to the cloud storage container. But I am not sure if I can have the reverse proxy send traffic to the cloud storage container if the cloud storage container is sitting behind the regular bridge network. But I also don't think I can assign the same IP to the cloud storage container.

When setting up the IPA server I mostly came across people saying it was absurd to try to host your LDAP server on a machine with other services running, but I don't have any other options really. If this was the main LDAP server for our organization that would be true, but this is a cluster used for research, which means justifying an entire dedicated server just for handling logon for ~10 users would be outlandish.

Maybe the solution is to put the IPA server in a container with its own IP address (something I tried before, and never quite got to work), allowing the reverse proxy to use port 80 on the normal machine. Or maybe a VM is a better solution.

But my main question is, can I assign an IP address to some kind of bridge network which would allow me to run a reverse proxy and other containers on a public IP address separate from the IPs for the hardware NICs on the machine?

Michael Hampton avatar
cz flag
You've heard of virtual machines, yes?
Score:0
cn flag

Okay, so I think I figured out a solution.

It turns out I can host the nginx reverse proxy container on a different port than port 80, in my case 8894, so that any requests to the URL for the cloud storage container on port 8894 would end up hitting the cloud storage container. So we have the following setup:

FreeIPA service running on port 80 for URL foo1.bar.com

Nginx reverse proxy running on port 8894

Cloud storage container running with the virtual host under foo2.bar.com

So now requests on plain foo2.bar.com still get redirected to foo1.bar.com, but requests on foo2.bar.com:8894 get redirected to the cloud storage container

This was achieved just by changing the port binding from -p 80:80 to -p 8994:80

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.