I have a wordpress website example.com. I have a single domain SSL certificate that can be used across multiple servers.
When a user visits example.com, or any subfolder expect forum , they access server1 which is running apache.
When a user vists example.com/forum they are redirected to server2 which runs nginx. How would I set such that both ip addresses are mapped under example.com such that the redirects are only internal and the domain remains example.com at all times
In my site apache vhost, I am using
Redirect permanent /forum http://server2ip
to redirect to server2
EDIT ACCORDING TO LUCA'S ANSWER TO SET server1 as PROXY to SERVER2
Here is my apache vhost config for the setup
VirtualHost *:80>
RewriteEngine on
ServerName example.com
ServerAdmin me@example.com
DocumentRoot /var/www/example
#Redirect all HTTP requests to HTTPS
# RewriteCond %{SERVER_PORT} 80
# RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
ProxyPass /forum https://server2ip/
<Location /forum>
ProxyPass https://server2ip/
ProxyPassReverse https://server2ip/
</Location>
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyHTMLEnable On
ProxyHTMLURLMap https://server2ip/ /forum
</VirtualHost>