2

I currently have a Sub Domain Proxies and Sub Folder Proxies working as seperate virtual hosts.

I want to minimise/simplify the code by combining.

My end game is to have Subdomains pointing to different Physical/Virtual Servers, while use subfolders to access different services in that server.

For Example:

www.example.com = Server 0 Apache
www.example.com/webmin = Server 0 Webmin

server1.example.com = Server 1 Apache
server1.example.com/webmin = Server 1 Webmin
server1.example.com/ad = Server 1 Active Directory UI

server2.example.com = Server 2 Apache
server2.example.com/webmin = Server 2 Webmin
server2.example.com/ad = Server 2 Active Directory UI

I have the following working thou as separate VirtualHosts:

#NAS as nas.example.com
ProxyPass / http://10.0.28.1:5000/
ProxyPassReverse / http://10.0.28.1:5000/

#Webmin as nas.example.com/webmin
ProxyPass /webmin/ http://10.0.28.1:10000/
ProxyPassReverse /webmin/ http://10.0.28.1:10000/

My guess is the first entry is overriding the second as the first is /. I just can't seem to nut out how to override and make both ReverseProxies work within the same

1 Answers1

1

Just tried reordering and it's still not working.

<VirtualHost *:443>
    # NAS
    ServerName nas.example.com
    ServerAdmin support@example.com
    DocumentRoot /mnt/WWW

    ProxyPass /webmin/ http://10.0.27.1:10000/
    ProxyPassReverse /webmin/ http://10.0.27.1:10000/

    ProxyPass / http://10.0.27.1:5000/
    ProxyPassReverse / http://10.0.27.1:5000/

    # SSL Certificates
    SSLEngine on
    SSLCertificateFile /root/ssl/example.com.crt
    SSLCertificateKeyFile /root/ssl/private.key
    SSLCACertificateFile /root/ssl/intermediateCA.crt

    # Error Logs
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The above is a reverse proxy to another server (the NAS). nas.example.com should be the NAS's default GUI while nas.example.com/webmin should point to Webmin on the same server (NAS). What is happening thou is /webmin returns a page from the NAS GUI saying the page cannot be found.