LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Reverse proxy (sub)domains to a different local server wihtout interrupting https (https://www.linuxquestions.org/questions/linux-server-73/reverse-proxy-sub-domains-to-a-different-local-server-wihtout-interrupting-https-4175676069/)

dr-ing 05-28-2020 09:59 AM

Reverse proxy (sub)domains to a different local server wihtout interrupting https
 
Hey,

I will try my best to describe my case:
I have 2 almost similar local servers (e.g. 10.0.0.1 and 10.0.0.2, both behind a pfsense firewall) and currently all web traffic (http and https) is directed to the 10.0.0.1 server running Apache2 with multiple vhosts.

These vhosts can be accessed either through a subdomain (e.g. alpha.myserver.net) or through a domain (e.g. beta.net), depending on the customer.

Now I want to move some vhosts (i.e. a few domains and subdomains) to the second server while the domains are still accessible with the same public IP, so I probably need a reverse proxy.

My question now is, is it possible to set up a reverse proxy that acts like a switch and checks the domain name and then decides if it belongs to the 10.0.0.1 or the 10.0.0.2 server without interrupting https?

shruggy 05-28-2020 10:16 AM

I guess a combination of RewriteCond and RewriteRule with a [P] flag can do it. Canonical Hostnames describes redirecting, but reverse proxy should be similar.


All times are GMT -5. The time now is 02:57 AM.