I set up a domain with port 443 open where all the traffic is coming in through.
I want to set up Apache2 as a reverse proxy so that when traffic comes into my domain depending on the subdomain, Apache will route it to the correct server within the network.
An Example
Domain entered -> Internal server Address
https://cloud.example.com -> 192.169.29.250 // Server where Nextcloud is running
https://git.example.com -> 192.169.29.200 // Server where GitLab is running
https://example.com -> 192.169.29.100 // Server where homepage (NodeJS) is running
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com *.example.com
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPass /cloud http://192.168.29.250
ProxyPassReverse /cloud http://192.168.29.250
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
So if I search for https://cloud.example.com I should reach the Nextcloud server within my network. Currently, what's happening is that I always land on the homepage. Help on how to properly route based on a subdomain will be appreshiated.