I have a Raspberry (say pi-1) running an apache2 web server that serves to the internet (my.domain).  I have a second Pi (pi-2) also running apache2 that serves to the local network over it's local IP address (192.168.1.100).  Is there a way to configure a subdomain of pi-1 - e.g. sub.my.domain - that relays requests on to 192.168.1.100 and responses back to the client?
                    
                        Add a comment
                    
                 | 
            
                
            
        
         
    1 Answer
You can setup apache on the first board with a virtual host entry that matches the sub-domain, and uses the mod_proxy module to send the request on to the second board.  See the example at
apache virtual hosts
<VirtualHost *:*>
    ProxyPreserveHost On
    ProxyPass "/" "http://192.168.1.100/"
    ProxyPassReverse "/" "http://192.168.1.100/"
    ServerName sub.my.domain
</VirtualHost>
    - 
        Thanks @meuh. Does this go in
/etc/apache2/apache2.conf?geotheory– geotheory2016-06-03 18:23:48 +00:00Commented Jun 3, 2016 at 18:23 - 
        I dont have apache on a pi, so I cannot say, but it goes in with the other configuration directives. But you really must read the linked-to page, and look up each of the directives above (ProxyPass and so on) so you understand what is going on. My answer is just a starting point.meuh– meuh2016-06-03 18:44:27 +00:00Commented Jun 3, 2016 at 18:44