Sorry for the long description. Problem with getting reverse proxy to work between 2 different computers on the same network in my home.
I am beating my head against the wall for over a week trying to set up a reverse Proxy so that I can access 2 web server computers, one running Apache and the other NGINX. I can setup the reverse proxies BEFORE I install the certificates and redirect to 443 (getting insecure warnings of course). However, when I run certbot (Let’s Encrypt) and setup the certificates, I ALWAYS get a too many redirects error in my browsers.
If I don’t try to utilize the reverse proxy, I can access the Virtual Hosts on which ever server the gateway points ports 80 and 443 to, even with Let’s Encrypts Certbots certificates in place. Of course, I can’t access the Virtual Hosts of the server that doesn’t have the gateway’s port 80 and 443 (thus the need/want for a reverse proxy solution.
I also tried to set the Apache server to reverse proxy to the NGINX server but received the same error “to many redirects’
When ports 80 and 443 are pointed to server ‘mini04’, I can access all of the Virtual Hosts, even with the Let’s Encrypt certificates in place. The web apps all work fine. When I point ports 80 and 443 to the server mail, I can access the RoundCube web app that was installed with the iRedMail package. I can even send and receive emails (and of course, the certificates are all setup). So individually, each server works fine.
I have wiped and reinstalled the OS on each server many times, because I would make so many changes to the system and the software based on internet searches.
I am using MacMini’s running Ubuntu server 24.04 on each server machine. I am using 2 MacMini’s because they are not very powerful and I wanted to split the processing between 2 computers. Plus, once I get everything running right, I want to leave the mail server alone and insure it stays up. The other machine is more of my play/development machine, so I’m not to worried if it goes down.
The common denominator (besides me) among all of this is some kind link between the Let’s Encrypt certificates, certbot and the reverse proxying configuration for the Virtual Hosts. iRedMail requires NGINX and as I understand, NGINX is supposed to be better at reverse proxying than Apache, so that’s why I’m using NGINX as the reverse proxy server.
I have installed all the proxy modules in Apache and enabled them. I see no additional errors in the Apache or NGINX logs other than those related to “to many redirects”.
I went with the iRedMail package because I could never get an email server setup by installing and configuring packages individually (SMTP, IMAP, POP3, RoundCube, certificates, etc). Because I keep wiping the mail server, and to avoid potential conflicts with trying to get the reverse proxy working.
I never found a tutorial on setting up a reverse proxy from the ground up and for two different computers (Installing the OS on 2 different computers, getting more than one Virtual Host working in each Web Server, getting a mail server going, access the mail from other computer and apps not just the mail app served from the mail server AND getting a reverse proxy working among it all). Much of what I found was/is out of date and many sites just cut and pasted the instructions from another site (a couple didn’t even fix the typos).
Once I get it working and understand it enough with my scenario, I plan to write up a detailed tutorial on how to do it all and post it out there for all. Of course, if someone knows where such a tutorial is, let me know. Of course, maybe I’m the only one who has ever wanted to do such a thing for a home network (business networks look like this often) and there is no need for such a tutorial; but I’ll make one anyway.
There is an accompanying diagram to help better understand what I am wanting and the problem I am having. Thanks in advance and I hope everyone has a happy and Blessed Thanksgiving.
Roger L Waldrip

